Note: Before running the container, on the host machine, the following command should be executed to allow the Docker containers to access the X server, so that graphical applications can be displayed:
$ xhost +local:docker
-
Install Docker Compose:
$ sudo apt install docker-compose
-
Verify the installation:
$ docker --version
Docker version 27.5.1, build 9f9e405
-
Grant permissions:
$ sudo chmod 777 /var/run/docker.sock
-
Once the Dockerfile and docker-compose.yml are ready, build the image:
$ docker compose --verbose build
-
Start the container:
$ docker compose up
Optionally run $ sudo ./start.sh
or...
-
To run the container based on the image you just created, use the following command:
$ docker run -it --name image-inpainting-app-docker-image docker_qt_application
-
Save the Docker image to a file (Export):
$ docker save -o image-inpainting-app-docker-image.tar docker_qt_application
This project allows running a Qt application inside a Docker container. Follow the steps below to download, load, and run the image.
Download the image from the provided link:
wget https://your-link.com/my_image.tar
Once downloaded, load the image into Docker:
docker load -i my_image.tar
To verify that the image was loaded correctly, run:
docker images
You should see something like this:
REPOSITORY TAG IMAGE ID CREATED SIZE
qt_image_inpainting_app latest abc123def456 2 hours ago 1.2GB
Clone this repository to get the required files (docker-compose.yml and start.sh):
git clone https://github.com/your-username/image-inpainting-app.git
cd image-inpainting-app
First, ensure that start.sh has execution permissions:
chmod +x start.sh
Then, run the script to launch the container:
./start.sh
If you need to check the logs without attaching the terminal, use:
docker logs -f qt_image_inpainting_app
To stop and remove the container, run:
docker-compose down
-
Restart the Docker service:
$ sudo systemctl restart docker
-
Check if it is active:
$ sudo systemctl status docker
-
Error while fetching server API version: Not supported URL scheme http+docker
Solution:
$ pip3 install requests==2.31.0
-
If the docker-compose.yml has syntax errors, the following command will show you:
$ docker compose config
-
Error KeyError: 'ContainerConfig' => Remove old (orphnn) containers that may be interfering:
$ docker compose down --remove-orphans docker system prune -af
To ensure that your changes are included in the Docker image, follow these steps:
- Compile the application on your host to make sure everything is up-to-date.
- Run
docker-compose down
to stop and remove the existing container. - Run
docker-compose up -d
to recreate the container. Docker will rebuild the image considering only the changes made to the source code, and then start the container with the updated image.
This process ensures that only the changes you made to the code are included in the new image before running the container again.
Once you have verified that the application works correctly, you can distribute it by uploading the Docker image to Docker Hub or another registry, or distribute it as a file.
-
Log in to Docker Hub:
$ docker login
-
Tag the image:
$ docker tag qt_image_inpainting_app <docker_hub_user>/<repository>:<tag>
-
Upload the image to Docker Hub:
$ docker push <docker_hub_user>/<repository>:<tag>
-
Now anyone can download and run the application with Docker:
$ docker run -it <docker_hub_user>/<repository>:<tag>