Created
January 14, 2015 22:35
-
-
Save freshjones/c1b0a72e7123cb8c7e0a to your computer and use it in GitHub Desktop.
Update a running docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "stop running container" | |
sudo docker stop <container_name> | |
echo "remove container" | |
sudo docker rm <container_name> | |
echo "remove current image" | |
sudo docker rmi <image>:current | |
echo "boot the container with latest" | |
sudo docker run -d -p <port>:<port> --name <container_name> <image>:latest | |
echo "tag a new current image" | |
sudo docker tag <image>:latest <image>:current | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment