virtualbox에서 vagrant 이미지가 있는 상태에서 docker를 설치했으나 ([docker설치] linux 3.8.0 이하에서 docker 설치/사용하기 ) boot2docker 가 새로 만들어지면서 virtualbox 에서 바로 사용가능하다.
아래와 같은 환경 구성이 가능하다고 해서 테스트해본다.
docker container
------------
docker server
------------
boot2docker
-----------
virtualbox
-----------
macos
-----------
boot2docker 설치
$ brew install docker boot2docker
$ docker -v
Docker version 1.1.2, build d84a070
$ boot2docker init
2014/09/03 01:43:43 Creating VM boot2docker-vm...
2014/09/03 01:43:43 Apply interim patch to VM boot2docker-vm (https://www.virtualbox.org/ticket/12748)
2014/09/03 01:43:43 Setting NIC #1 to use NAT network...
2014/09/03 01:43:43 Port forwarding [ssh] tcp://127.0.0.1:2022 --> :22
2014/09/03 01:43:43 Port forwarding [docker] tcp://127.0.0.1:2375 --> :2375
2014/09/03 01:43:43 Setting NIC #2 to use host-only network "vboxnet0"...
2014/09/03 01:43:43 Setting VM storage...
2014/09/03 01:43:49 Done. Type `boot2docker up` to start the VM.
$ boot2docker up
2014/09/03 01:49:28 Waiting for VM to be started...
...........
2014/09/03 01:50:00 Started.
2014/09/03 01:50:00 To connect the Docker client to the Docker daemon, please set:
2014/09/03 01:50:00 export DOCKER_HOST=tcp://192.168.59.104:2375
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker version
Client version: 1.1.2
Client API version: 1.13
Go version (client): go1.2.1
Git commit (client): d84a070
Server version: 1.1.2
Server API version: 1.13
Go version (server): go1.2.1
Git commit (server): d84a070
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker pull dockerfile/ghost
Pulling repository dockerfile/ghost
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
dockerfile/ghost latest aad91b0a4e83 35 minutes ago 602.8 MB
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker run -d -p 80:2368 dockerfile/ghost
36f61ab4f3ae10befe661d516380a56465643b75c62383f6c3486aa60014da7c
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36f61ab4f3ae dockerfile/ghost:latest bash /ghost-start 22 minutes ago Up 22 minutes 0.0.0.0:80->2368/tcp angry_curie
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker stop 36f61ab4f3ae
36f61ab4f3ae
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
가상 컨테이너인 dockerfile/ghost 이미지 OS의 터미널 접근할 때 다음 명령어를 이용한다.
$ DOCKER_HOST=tcp://192.168.59.104:2375 docker run -i -t dockerfile/ghost /bin/bash
'scribbling' 카테고리의 다른 글
[play] 예제(샘플) 이용하기 (0) | 2014.09.15 |
---|---|
arcus 를 mac에 설치하기 (테스트 환경) (0) | 2014.09.11 |
[docker설치] linux 3.8.0 이하에서 docker 설치/사용하기 (0) | 2014.09.03 |
github flow (git flow 말고) (0) | 2014.09.01 |
[소프트웨어 공학센터 기고] Vagrant와 Ansible을 이용한 개발 환경 (0) | 2014.08.21 |