Как стать автором
Обновить

Комментарии 9

Ух, сколько, оказывается, полезностей после 1.1 вышло %).
Когда просто статейки попадаются на глаза, как-то думаешь, что докер — он всё тот же, который в руках год назад вертел. А он, оказывается, семимильными шагами идёт.
Firefox 39, на сайте не работает калькулятор цены на контейнеры.
Очень недурные изменения оказывается были, с момента, когда я им последний раз пользовался.
Особенно порадовала поддержка IPv6, и docker-compose. :)
Упоминается docker-machine — пока beta, но для дев-окружения подойдет отлично. Теперь это официальный способ запускать docker на маках, вместо boot2docker. Плюс они планируют интегрировать эту утилиту с другими компонентами.

docker-compose любопытный, подъем согласованного кластера Vagrant'ом на маке был не самым тривиальным способом, надо освоить.
Может ли Docker Compose заменить Vagrant?

Задача — обеспечить одинаковое окружение проекта для всех разработчиков и серверов.
docker-compose — это всего лишь утилита для оркестрации, которую удобно использовать для того, чтобы запустить несколько контейнеров, которые конфигурируются в yml-файле. установка и конфигурирование софта, который будет использоваться в контейнере, производится либо в Dockerfile-е либо в bootstrap-скрипте, который помещается в контейнер и запускается вместе с ним при запуске. Docker может заменить Vagrant
Коллеги infobox и другие коллеги, может кто сталкивался:

System error: no such file or directory


при попытке docker-compose up.

Дебаг не помогает.

yml файл простой:

db:
  image: postgres
  ports:
    - "5432"


Docker 1.7.1, Compose 1.3.3. Гугл не особо помогает, как и багтрекер Compose.

Help :)
Прошло некоторое время и я не знаю решилась ли у Вас проблема, но у меня контейнер поднялся:
Вот мой лог
habr$ sudo docker-compose up
Creating habr_db_1...
Pulling image postgres:latest...
latest: Pulling from postgres

843e2bded498: Pull complete
8c00acfb0175: Pull complete
72893ec31c4c: Pull complete
640a8e5c87b4: Pull complete
c370f4f57320: Pull complete
ae0f1b627d5e: Pull complete
1ee7d372b3e2: Pull complete
716505dd384f: Pull complete
5f1b1f91bfd4: Pull complete
241d4bf7490c: Pull complete
b924e91017bc: Pull complete
5ea6304ae9d3: Pull complete
7f2fa48b55fb: Pull complete
2ad0abeca190: Pull complete
a04ebe635e69: Pull complete
0e57c609ffa9: Pull complete
a9e279ca41a9: Pull complete
8d2164ecd807: Pull complete
1f89bef4c5c4: Pull complete
c540273be9bb: Pull complete
506c40f60539: Pull complete
postgres:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:a11e806f65a093bde78acb1ecc0182adcb7e9fe61176344b903442517012fc4a
Status: Downloaded newer image for postgres:latest
Attaching to habr_db_1
db_1 | The files belonging to this database system will be owned by user "postgres".
db_1 | This user must also own the server process.
db_1 | 
db_1 | The database cluster will be initialized with locale "en_US.utf8".
db_1 | The default database encoding has accordingly been set to "UTF8".
db_1 | The default text search configuration will be set to "english".
db_1 | 
db_1 | Data page checksums are disabled.
db_1 | 
db_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1 | creating subdirectories ... ok
db_1 | selecting default max_connections ... 100
db_1 | selecting default shared_buffers ... 128MB
db_1 | selecting dynamic shared memory implementation ... posix
db_1 | creating configuration files ... ok
db_1 | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
db_1 | initializing pg_authid ... ok
db_1 | initializing dependencies ... ok
db_1 | creating system views ... ok
db_1 | loading system objects' descriptions ... ok
db_1 | creating collations ... ok
db_1 | creating conversions ... ok
db_1 | creating dictionaries ... ok
db_1 | setting privileges on built-in objects ... ok
db_1 | creating information schema ... ok
db_1 | loading PL/pgSQL server-side language ... ok
db_1 | vacuuming database template1 ... ok
db_1 | copying template1 to template0 ... ok
db_1 | copying template1 to postgres ... ok
db_1 | syncing data to disk ... 
db_1 | WARNING: enabling "trust" authentication for local connections
db_1 | You can change this by editing pg_hba.conf or using the option -A, or
db_1 | --auth-local and --auth-host, the next time you run initdb.
db_1 | ok
db_1 | 
db_1 | Success. You can now start the database server using:
db_1 | 
db_1 |     postgres -D /var/lib/postgresql/data
db_1 | or
db_1 |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1 | 
db_1 | ****************************************************
db_1 | WARNING: No password has been set for the database.
db_1 |          This will allow anyone with access to the
db_1 |          Postgres port to access your database. In
db_1 |          Docker's default configuration, this is
db_1 |          effectively any other container on the same
db_1 |          system.
db_1 | 
db_1 |          Use "-e POSTGRES_PASSWORD=password" to set
db_1 |          it in "docker run".
db_1 | ****************************************************
db_1 | waiting for server to start....LOG:  database system was shut down at 2015-09-21 10:11:01 UTC
db_1 | LOG:  MultiXact member wraparound protections are now enabled
db_1 | LOG:  database system is ready to accept connections
db_1 | LOG:  autovacuum launcher started
db_1 |  done
db_1 | server started
db_1 | ALTER ROLE
db_1 | 
db_1 | 
db_1 | /docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1 | 
db_1 | waiting for server to shut down....LOG:  received fast shutdown request
db_1 | LOG:  aborting any active transactions
db_1 | LOG:  autovacuum launcher shutting down
db_1 | LOG:  shutting down
db_1 | LOG:  database system is shut down
db_1 |  done
db_1 | server stopped
db_1 | 
db_1 | PostgreSQL init process complete; ready for start up.
db_1 | 
db_1 | LOG:  database system was shut down at 2015-09-21 10:11:02 UTC
db_1 | LOG:  MultiXact member wraparound protections are now enabled
db_1 | LOG:  database system is ready to accept connections
db_1 | LOG:  autovacuum launcher started


Возможно проблема еще в чем-то. Я создал файл docker-compose.yml и поместил туда Ваш код.
Когда я переименовал файл, то при запуске увидел следующее:
habr$ sudo docker-compose up
Can't find a suitable configuration file. Are you in the right directory?

Supported filenames: docker-compose.yml, docker-compose.yaml, fig.yml, fig.yaml

Возможно, Вы неправильно обозвали файл с конфигурацией?
Здравствуйте! 1. Файл должен называться именно docker-compose.yml. 2. Пожалуйста используйте наше руководство по установке Docker и Compose (в начале статьи в спойлере) на CentOS 7 VM – так вы получите последние версии Docker и Compose, которые легко можно будет обновлять. В прошлых были проблемы.
Зарегистрируйтесь на Хабре, чтобы оставить комментарий