OS X: установка Docker

Автор: | 11/16/2015
 

OS_X_Mavericks_LogoОперационная система:

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.10.5 (14F27)
      Kernel Version: Darwin 14.5.0
      ...

Устанавливаем Docker с помощью Homebrew:

$ brew install docker

Устанавливаем Boot2Docker:

$ brew install boot2docker

Инициализируем Virtualbox машину, в которой будут запускаться Docker-контейнеры:

$ boot2docker init
...
Initialization of virtual machine "boot2docker-vm" complete.
Use `boot2docker up` to start it.

Запускаем её:

$ boot2docker up
...
To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.103:2376
    export DOCKER_CERT_PATH=/Users/user/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
...

Добавляем переменные:

$ export DOCKER_HOST=tcp://192.168.59.103:2376
$ DOCKER_CERT_PATH=/Users/user/.boot2docker/certs/boot2docker-vm
$ export DOCKER_TLS_VERIFY=1

Подключаем сертификаты:

$ $(boot2docker shellinit)
Writing /Users/user/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/user/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/user/.boot2docker/certs/boot2docker-vm/key.pem

Проверяем:

$ docker info
Containers: 0
Images: 0
Server Version: 1.9.0
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.12-boot2docker
Operating System: Boot2Docker 1.9.0 (TCL 6.4); master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015
CPUs: 8
Total Memory: 1.955 GiB
Name: boot2docker
ID: LJRC:3GOY:GDWM:RFUU:ARA7:YKF4:DPR5:U6DO:23FB:YOAX:XK75:3O5N
Debug mode (server): true
 File Descriptors: 11
 Goroutines: 18
 System Time: 2015-11-09T10:45:15.32718567Z
 EventsListeners: 0
 Init SHA1:
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker

Готово.