0

I have this docker-composer.yml file that starts 4 services: a web portal, a mysql db an elastisearch and kibana service.

If I use as db image mysql:latest, I see all 4 services starting. But if I use as image mysql:5.7 the db is not starting.

I can't figure out why. I tried to start the db image alone and it works. It is together with the rest that doesn't seem to work.

version: '3'
 services:
  portal:
   image: glassofwhiskey/liferay-portal:7.0-ce-ga5-dev
   networks:
    - lfrnet
   ports:
    - "8000:8000"
    - "8080:8080"
    - "11311:11311"
  db:
   image: mysql:5.7
   environment:
     MYSQL_ROOT_PASSWORD: secret
   networks:
     - lfrnet
   ports:
    - "3306:3306"
   volumes:
    - db-data:/var/lib/mysql
  elasticsearch:
    image: glassofwhiskey/elasticsearch:2.4
    environment:
      ES_JAVA_OPTS: "-Xms512m -Xmx512m"
    networks:
     - lfrnet
    ulimits:
      memlock:
       soft: -1
       hard: -1
    volumes:
     - elasticsearch-data:/usr/share/elasticsearch/data
  kibana:
   image: kibana:4.6
   networks:
     - lfrnet
    ports:
     - "5601:5601"
 networks:
   lfrnet:
 volumes:
   db-data:
   elasticsearch-data:

I'm working on a Ubuntu machine with latest docker version. But I found the same behaviour trying the docker composer file on https://labs.play-with-docker.com/

I start with

docker-compose up --force-recreate -d

And I check the db is not running with

docker stats

No idea how to troubleshoot this.

Glasnhost
  • 541
  • 3
  • 10
  • 19

1 Answers1

1

You can check the errors after you start the docker-compose file by the following steps:

  • docker ps to get the container ID
  • docker logs --follow --details <CONTAINER ID> to check the error

Just something crossed my mind:

  • This might be caused by conflicting in the MySQL data as you are using a volume so make sure you use different volume for every version
Kerolos William
  • 305
  • 1
  • 13