Created
November 24, 2014 23:00
-
-
Save mapyo/1e120ae4052ec4fd4870 to your computer and use it in GitHub Desktop.
MacでDockerを入れて自分で作ったイメージを保存するまで ref: http://qiita.com/mapyo/items/f90f9a6fac5a600ea21e
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
$ brew install docker boot2docker | |
$ docker -v | |
Docker version 1.3.1, build 4e9bbfa | |
$ boot2docker -v | |
Boot2Docker-cli version: v1.3.1 |
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
$ brew update | |
$ brew upgrade docker | |
$ brew upgrade boot2docker |
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
$ boot2docker init | |
$ boot2docker up | |
Waiting for VM and Docker daemon to start... | |
.......................ooo | |
Started. | |
Writing /Users/mapyo/.boot2docker/certs/boot2docker-vm/ca.pem | |
Writing /Users/mapyo/.boot2docker/certs/boot2docker-vm/cert.pem | |
Writing /Users/mapyo/.boot2docker/certs/boot2docker-vm/key.pem | |
To connect the Docker client to the Docker daemon, please set: | |
export DOCKER_HOST=tcp://192.168.59.104:2376 | |
export DOCKER_CERT_PATH=/Users/mapyo/.boot2docker/certs/boot2docker-vm | |
export DOCKER_TLS_VERIFY=1 |
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
docker pull centos:centos6 |
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
$ docker images | |
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE | |
centos centos6 70441cac1ed5 3 weeks ago 215.8 MB |
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
$ docker run -t -i --name hoge centos:centos6 /bin/bash | |
[root@612cf98173a6 /]# |
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
[root@612cf98173a6 /]# yum install vim | |
# いろいろ | |
[root@612cf98173a6 /]# exit |
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
$ docker ps -a | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
612cf98173a6 centos:centos6 "/bin/bash" 15 minutes ago Exited (0) 9 minutes ago hoge |
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
$ docker commit hoge mapyo/hoge-image:0.0.1 |
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
$ docker images | |
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE | |
mapyo/hoge-image 0.0.1 a68a12549598 12 minutes ago 306.3 MB | |
centos centos6 70441cac1ed5 3 weeks ago 215.8 MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment