skip to Main Content

I am trying to build a set of Docker images that includes an installation of Magento 2 and MariaDB. In rare cases it succeeds (although this could be due to small changes in the app), but in most cases it is stuck on the following:

magento2-db    | Version: '10.3.11-MariaDB-1:10.3.11+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

I see that someone else had this issue, but the cause was actual RUN commands for MariaDB installation, which I don’t directly call. There doesn’t seem to be anything in the log to indicate an error either.

The last lines in the log are:

[16:49:18.424][Moby           ][Info   ] [25693.252573] br-83922f7da47b: port 2(vethac51834) entered blocking state
[16:49:18.453][Moby           ][Info   ] [25693.290035] br-83922f7da47b: port 2(vethac51834) entered forwarding state
[16:49:18.637][ApiProxy       ][Info   ] time="2018-11-28T16:49:18+02:00" msg="proxy << POST /v1.25/containers/67175238f0e7a75ef527dbebbb1f5d992f1d01ee166643186dc5f727638aa66b/start (1.0560013s)n"
[16:49:18.645][ApiProxy       ][Info   ] time="2018-11-28T16:49:18+02:00" msg="proxy >> GET /v1.25/events?filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmagento2%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7Dn"

It seems to actually finish executing all steps in the Dockerfile, but I suspect there might be a problem in my docker-compose file, which looks like this:

version: '3.0'
services:
  app:
    build:
      context: .
      dockerfile: .docker/Dockerfile
    container_name: 'magento-2.2.6'
    ports:
      - "80:80"
    volumes:
      - magento2-test-env:/var/www/html/magento2 # will be mounted on /var/www/html
    links:
      - magento2-db
    env_file:
      - .docker/env
    depends_on:
      - magento2-db
  magento2-db:
    container_name: 'magento2-db'
    image: mariadb:latest
    ports:
      - "9809:3306"
    volumes:
      - magento2-db-data:/var/lib/mysql/data
    env_file:
      - .docker/env
volumes:
  magento2-db-data:
  magento2-test-env:
    external: true

Is there anything obviously wrong with my setup, and is there a good way to troubleshoot this, maybe look for something specific in the log?

2

Answers


  1. maybe the way you’re building your composer what’s the problem.

    Try use this one:

    version: '3.0'
    services:
      app:
        build:
          context: .
          dockerfile: .docker/Dockerfile
        container_name: 'magento-2.2.6'
        ports:
          - "80:80"
        volumes:
          - magento2-test-env:/var/www/html/magento2 # will be mounted on /var/www/html
        links:
          - magento2-db
        env_file:
          - .docker/env
        depends_on:
          - db
      db:
        container_name: 'magento2-db'
        image: mariadb:latest
        ports:
          - "9809:3306"
        volumes:
          - /var/lib/mysql/data
        env_file:
          - .docker/env
    volumes:
      magento2-db-data:
      magento2-test-env:
        external: true
    

    Avoid to use services names like ‘blabla-something’ if you need put a name use as container_name it’ll be enough, and the db, links always should links in the services itself no in the containers name.

    I hope this could help you.

    Login or Signup to reply.
  2. Try setting -e MYSQL_INITDB_SKIP_TZINFO=1, refer to this issue.

    e.g.

    docker run -it --rm -e MYSQL_INITDB_SKIP_TZINFO=1 ... mariadb:10.4.8
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search