Hi,
I have a problem rewriting an existing docker-compose-file to version 2.
docker-compose --version
docker-compose version 1.6.2, build 4d72027
Choosing the following format works:
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
docker-compose up
dennis_db_1 is up-to-date
dennis_wordpress_1 is up-to-date
Attaching to dennis_db_1, dennis_wordpress_1
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] mysqld (mysqld 10.1.12-MariaDB-1~jessie) starting as process 1 ...
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Using mutexes to ref count buffer pool pages
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: The InnoDB memory heap is disabled
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Memory barrier is not used
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Compressed tables use zlib 1.2.8
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Using Linux native AIO
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Using SSE crc32 instructions
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Initializing buffer pool, size = 256.0M
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: 128 rollback segment(s) are active.
wordpress_1 |
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Waiting for purge to start
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.28-76.1 started; log sequence number 1616859
db_1 | 2016-03-09 21:56:17 140260499490560 [Note] InnoDB: Dumping buffer pool(s) not yet started
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] Server socket created on IP: '::'.
db_1 | 2016-03-09 21:56:17 140261288413120 [Warning] 'proxies_priv' entry '@% root@7ecd0170d305' ignored in --skip-name-resolve mode.
db_1 | 2016-03-09 21:56:17 140261288413120 [Note] mysqld: ready for connections.
db_1 | Version: '10.1.12-MariaDB-1~jessie' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
wordpress_1 | Warning: mysqli::mysqli(): (HY000/2002): Connection refused in - on line 10
wordpress_1 |
wordpress_1 | MySQL Connection Error: (2002) Connection refused
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | [Wed Mar 09 21:56:20.220296 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/5.6.18 configured -- resuming normal operations
wordpress_1 | [Wed Mar 09 21:56:20.220623 2016] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
wordpress_1 | 172.17.0.1 - - [09/Mar/2016:22:32:35 +0000] "POST /wp-admin/install.php?step=1 HTTP/1.1" 200 2754 "http://localhost:8080/wp-admin/install.php" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0"
I would like now to rewrite this to version 2:
version: "2"
services:
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
But running this leads to an error:
docker-compose up
Recreating dennis_db_1
Recreating dennis_wordpress_1
Attaching to dennis_db_1, dennis_wordpress_1
wordpress_1 | error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables
wordpress_1 | Did you forget to --link some_mysql_container:mysql or set an external db
wordpress_1 | with -e WORDPRESS_DB_HOST=hostname:port?
db_1 | 2016-03-09 22:40:52 140029594867648 [Note] mysqld (mysqld 10.1.12-ariaDB-1~jessie) starting as process 1 ...
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Using mutexes to ref count buffer pool pages
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: The InnoDB memory heap is disabled
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Memory barrier is not used
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Compressed tables use zlib 1.2.8
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Using Linux native AIO
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Using SSE crc32 instructions
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Initializing buffer pool, size = 256.0M
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: The log sequence numbers 1616859 and 1616859 in ibdata files do not match the log sequence number 2534745 in the ib_logfiles!
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Database was not shutdown normally!
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Starting crash recovery.
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Reading tablespace information from the .ibd files...
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: Restoring possible half-written data pages
db_1 | 2016-03-09 22:40:53 140029594867648 [Note] InnoDB: from the doublewrite buffer...
dennis_wordpress_1 exited with code 1
I don’t have any idea why, following https://docs.docker.com/compose/compose-file/ the upgrading-section, these are the only changes I have to make.
Why this doesn’t work?