Created
January 12, 2014 18:27
-
-
Save jacobat/8388444 to your computer and use it in GitHub Desktop.
First shell1 - build, run, and change a running container
Then shell2 - commit and enter new container
This file contains 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
jacob@sales01:~/timebuild$ cat Dockerfile | |
FROM ubuntu | |
ADD . /foo | |
jacob@sales01:~/timebuild$ sudo docker build -t commitbuild . | |
Uploading context 10.24 kB | |
Uploading context | |
Step 1 : FROM ubuntu | |
---> 8dbd9e392a96 | |
Step 2 : ADD . /foo | |
---> d4e96c9ed83a | |
Successfully built d4e96c9ed83a | |
jacob@sales01:~/timebuild$ sudo docker run -i -t commitbuild /bin/bash | |
root@b11c28d141e8:/# ls | |
bin boot dev etc foo home lib lib64 media mnt opt proc root run sbin selinux srv sys tmp usr var | |
root@b11c28d141e8:/# echo "change" > change | |
root@b11c28d141e8:/# |
This file contains 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
jacob@sales01:~$ sudo docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
b11c28d141e8 commitbuild:latest /bin/bash 32 seconds ago Up 31 seconds hopeful_galileo | |
jacob@sales01:~$ sudo docker commit b11c28d141e8 | |
8a10d9332ea6c3686145e59095f1e4fbd9ad3b4962295861b65d51f02532dd09 | |
jacob@sales01:~$ sudo docker run -i -t 8a10d9332ea6c3686145e59095f1e4fbd9ad3b4962295861b65d51f02532dd09 /bin/bash | |
root@666254c0005e:/# cat change | |
change | |
root@666254c0005e:/# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment