![]() # Startup the VNC server vncserver $DISPLAY -nohttpd -depth 32 -geometry $VNC_RESOLUTION -name "Ubuntu VNC" if || ] then echo -e "Waiting for VNC server to exit" wait # Startup the SSH server sudo /usr/sbin/sshd # Apply permissions sudo find $HOME/ -name '*.desktop' -exec chmod $verbose a+x + # Set the password PASSWD_PATH = "$HOME /.vnc/passwd" echo "user:$PASSWORD " | sudo chpasswdĮcho "$PASSWORD " | vncpasswd -f > $PASSWD_PATH & chmod 600 $PASSWD_PATH This can be handy if you want a quick temporary execution environment and it can be blown away when it’s finished. This is required so the Docker container doesn’t immediately die.Īlternatively, if a custom command is passed in when starting the container, that will be run instead. Then it starts the SSH server and VNC server.įinally it waits for infinity (or a Ctrl+C) if the default -wait command is passed in. I also chose to put this in the startup script so that if anyone extends the Docker image using it as the base of their image, any extra icons they copy in will also get the permissions updated at container launch. ![]() It then overrides the permissions for any launcher icons on the desktop to make them executable. This is done in the startup script so that we can override it when starting up the container - if we were to set this when building the container, we would be unable to override it at runtime without rebuilding the image. I also found this repo here and looked at how they had setup X11 forwarding from the container.Īs I wanted up to date software, I chose Ubuntu 19.04 as the base image (19.10 is coming soon!)ĬOPY home/ $HOME/ COPY start.sh /startup/start.sh RUN sudo chmod +x /startup/start.sh ENTRYPOINT CMD īelow you can see the startup Bash script which is performing a few tasks before it finally starts waiting for infinity (it never comes )).įirst it sets the user account and VNC passwords to those passed in using the PASSWORD environment variable. I took a lot of inspiration from here to find out how to build the container - I decided not to use that image as a base as I wanted more recently up-to-date software. Then I saw something on Hacker News that piqued my interest, lo and behold, it had what I was looking for. I initially searched around in 2018, but couldn’t find anything at the time (probably a dodgy search effort on my behalf □♂️). I’ve wondered for some time now whether it would be possible to get a headless X11 desktop working in Docker. Decent looking desktop and GUI theme - no Windows 95/98-esque action here please.Easy to make persistent changes to the image when required.Semi-recent versions of applications installed.Volumes mapped to my persistent storage drives automatically.Simple setup - no stuffing around with arguments or variables every time I want to rebuild it.I’ve looked into many options like VM’s or one-off scripts to install everything - even products like Deep Freeze - but nothing suited all my needs. A PC where you can just blow it away by rebooting and you are back to a known-working state. I’ve always loved the idea of having an immutable workstation (with the exception of data storage of course □).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |