Docker - Update software of docker container

Revision as of 11:32, 13 October 2019 by Ardaut (talk | changes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Docker containers should not store application data. Application data is saved in Docker volumes.
Download the new Docker application software with "pull". Then stop and restart the Docker container.

docker pull mysql
docker stop mysql_container_name 
docker rm mysql_container_name 
docker run --name=mysql_container_name --restart=always \
  -e MYSQL_ROOT_PASSWORD=YOUR_PASSWORD -v /my/data/dir:/var/lib/mysql -d mysql