Это старая версия документа!


Docker

VIRTUAL MACHINES CONTAINERS
Virtual machines include the application, the necessary binaries and libraries, and an entire guest operating system – all of which can amount to tens of GBs. Containers include the application and all of its dependencies –but share the kernel with other containers, running as isolated processes in user space on the host operating system. Docker containers are not tied to any specific infrastructure: they run on any computer, on any infrastructure, and in any cloud.
Для справки
$ docker image

Вывести список образов

$ docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
yii2_php                     latest              6a950c96e01d        23 hours ago        159MB

Удалить образ

$ docker image rm 6a950c96e01d

Анализировать образ

$ docker image inspect 6a950c96e01d
[
    {
        "Id": "sha256:6a950c96e01de12b463f1fce232b48f530c487c2d7af5fef2e59c693c21c8af1",
        "RepoTags": [
            "yii2_php:latest"
        ],
        "RepoDigests": [],
        "Parent": "sha256:a0883c
...
}

Избавляемся от неиспользуемых образов

$ docker image prune

Список образов

$ docker image ls
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
yii2_php                     latest              6a950c96e01d        23 hours ago        159MB
yii2_nginx                   latest              878bb2a77dfa        27 hours ago        23.2MB
yii2_kibana                  latest              e3f6594b57e1        27 hours ago        221MB
yii2_elasticsearch           latest              117a536c2655        27 hours ago        129MB
yii2_redis                   latest              546a364104fd        27 hours ago        31.1MB
yii2_mariadb                 latest              03ddc39bcf15        27 hours ago        204MB
Для справки
$ docker

Проблемы и их решения

Возникает при циклическом связывании контейнеров (2-ух сторонее связывание) В качестве решенияпроблемы, на данный момент, можно воспользоваться прокси сервером/контейнером docker-grand-ambassador

fpm:
  build: ./build/fpm
  links:
    - ambassador:nginx
nginx:
  build: ./build/nginx
  links:
    - ambassador:fpm
ambassador:
  image: cpuguy83/docker-grand-ambassador
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
  command: "-name testapp_fpm_1 -name testapp_nginx_1"

скорее всего вам потребуется сделать следующее:

$ docker-machine create --driver=xhyve dev --xhyve-experimental-nfs-share

Компоненты

  • docker-compose - Компановщик контейнеров
  • docker-machine - Это инструмент, позволяющий управлять удалёнными хостами Docker с локального компьютера.
  • Docker Toolbox - Комплект необходимых программ для Windows или MacOs (Внимание!!! ставит VirtualBox )
  • Weave Scope - Это очень удобный и наглядный сервис для мониторинга Docker контейнеров.
  • cAdvisor - Система мониторинга за контейнерами

Документация / Статьи

Другие системы виртуализации