Created
March 30, 2017 08:44
-
-
Save jamesattard/e378e71dc9cc280c8889b4f584bd0edb to your computer and use it in GitHub Desktop.
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
| # First get ID of running container | |
| $ docker ps | |
| CONTAINER ID ... | |
| 5776d1849024 ... | |
| # Next we take a snapshot of the docker container by first pausing (-p) the container | |
| $ docker commit -p 5776d1849024 mysql | |
| e09f9ac65c8b3... | |
| # The commit arg saves the entire snapshot as a docker image with a name mysql: | |
| $ docker images | |
| REPOSITORY TAG IMAGE ID ... | |
| mysql latest 5776d1849024 ... | |
| # To save to a docker repo: | |
| $ docker login | |
| $ docker push mysql | |
| # To save as tarball: | |
| $ docker save -o mysql.tar mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment