免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年4月13日 星期一

docker commit a running container to a new image


http://stackoverflow.com/questions/25211198/docker-how-to-change-repository-name-or-rename-image

# mycontainer1 is the container name
# myimg1 is the image name
$ docker run --name="mycontainer1" myimg1
...
... make some changes to container
...

# commit changes and save to the new image name (image tag)
$ docker commit mycontainer1 username/new_img2:new_tag

$ docker rm -f mycontainer1


# push image to dockerHub
$ docker push username/new_img2:new_tag

沒有留言:

張貼留言