The docker-compose up command doesn’t check a registry for a newer version of an image if it finds the image:latest among the locally cached images. So after a while you may find, that despite of the :latest tag of the image in a docker-compose.yml file, the docker-compose up command doesn’t pull the latest version of […]
In a Docker Compose, you can set environment variables in a service’s containers or overwrite variables that are defined in the Dockerfile of the images you’re running. To pass the environment variables to the containers, you can use the environment key in a docker-compose.yml file, that works just like a docker run -e VAR=VALUE … […]
By default, the docker-compose (up|stop|restart|build) commands will start, stop, restart or build all of the services (containers) listed in a docker-compose.yml file. But there is also a way to run docker-compose commands against the certain containers only. This is useful when you need for example to re-build just one container described as a service in […]
By default, a Docker Compose starts the services in the foreground mode just like a docker run command. To run the Docker Compose in the background, a docker-compose up command should be started with the -d or –detach option. In this short note i am showing how to run the Docker Compose in the detached […]
The docker-compose build or docker-compose up –build commands read the docker-compose.yml file looking for all services containing the build configuration option and run a docker build command for each of them. If the Dockerfile has been renamed or placed out of the context directory, you can specify the alternate path in the Docker Compose file. […]
This short note shows how to remove all Docker images and containers. Use these commands with caution as they force the removal of all the Docker images and containers including the running ones.
A minimal Docker image based on Alpine Linux has only 5 MB in size, but a lot of packages common for Linux distributions are not installed by default. In this short note i will show how to install a package in Alpine container from the command line using the apk (Alpine package manager). I will […]
To start using a private Docker Registry a user usually should run the docker login command and set a username and password that will be cached locally. If a user tries to docker pull or docker push an image from/to a private Docker Registry, without having run the docker login command in advance, he may […]
Multiple commands can be executed in a running Docker container using the docker exec command. If the Docker container is stopped, before running the docker exec command it should be started using the docker run command. In this short note i will show the examples of how to execute multiple commands in a Docker container.
The docker exec command serves for executing commands in a running container. If the Docker container is stopped, before running the docker exec command it should be started using the docker run command. In this short note i will show the examples of how to execute commands Docker containers.