Вот как вы можете обновить развернутый контейнер после обновления образа в Docker Hub.
Сначала вы останавливаете контейнер:
docker stop <ID or name>Then you remove the container:
docker rm <ID or name>Then you pull the image from Docker Hub:
docker pull <image name>Then you start a new container from the image:
docker run <image name> ...optionsOf course that’s not practical to do manually.
Applications like Watchtower, deployed as a Docker container, lets you setup an automated workflow for watching changes on Docker Hub (or any other image registry) and automatically gracefully shut down an existing container and restart it with the same options that were used to deploy it initially.
More docker tutorials:
- Introduction to Docker
- Introduction to Docker Images
- Introduction to Docker Containers
- Dockerfiles
- Installing Docker on macOS
- First steps with Docker after the installation
- Using Docker Desktop to manage a Container
- Create a simple Node.js Hello World Docker Container from scratch
- What to do if a Docker container immediately exits
- Working with Docker Containers from the command line
- Working with Docker Images from the command line
- Sharing Docker Images on Docker Hub
- How to access files outside a Docker container
- How to commit changes to a Docker image
- Updating a deployed container based on a Docker image