This repository contains a Docker image of an Ubuntu container running Thunderbird and Gimp. It's meant to be used as a template to show how you can Dockerize any application. Go to How to Dockerize a different application
section to see how you can Dockerize another application.
You can build all you need by running:
docker compose build
Now you need to edit APP_USERNAME inside docker-compose.yml with your desired username. The next step is to generate an APP_PASSWORD_HASH by running with password 'mypass' of your choice:
docker run --rm -it vnc-caddy caddy hash-password -plaintext 'mypass'
Paste the output of the above command into APP_PASSWORD_HASH and you are set to go.
Then start the containers with:
docker compose up
I decided to call the image vnc-docker, this is an arbitrary choice. Build the container by running:
docker build -t vnc-app .
Create the network:
docker network create vnc-net
Create the volume for storing data:
docker volume create vnc-data
Run the container in detached mode:
docker run --detach --restart=always --volume=vnc-data:/data --net=vnc-net --name=vnc-app vnc-app
Good! You can replace --name=vnc-app
with any name you want.
We will use Caddy to connect to the Docker container. All the configurations files are inside the caddy
folder.
In short, the Caddyfile proxies the root directory to the vnc-app container you just created. Here's what you need to do:
-
Build up the Caddy container run:
cd caddy && docker build -t vnc-caddy .
-
Generate an hash for login. This command will output an hash. Copy this to your clipboard in preparation of running the next command:
docker run --rm -it vnc-caddy caddy hash-password -plaintext 'mypass'
-
Copy/paste the hash and run the container in detached mode:
docker run --detach --restart=always --volume=vnc-data:/data --net=vnc-net --name=vnc-web --env=APP_USERNAME="myuser" --env=APP_PASSWORD_HASH="mypass-hash" --publish=8080:8080 vnc-caddy
Open a new broswer tab and tap http://your_server_ip:8080
. You should see a login page. Login with the user and password used when building the Caddy container.
You can also access files by opening http://your_server_ip:8080/files
If you want to containerize a different application, follow these steps:
- Add another element
<execute>/usr/bin/<application></execute>
inside menu.xml - Change the label of the item in
[program:<application>]
inside supervisord.conf, as explained in the Supervisor Documentation - install the application inside Dockerfile (see comment)