Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i am modefing the docker-compose.yml with some foren containers it fails to auto start on reboot #41

Closed
devsaumya opened this issue May 2, 2020 · 4 comments · Fixed by #576

Comments

@devsaumya
Copy link

whenever the container is updated, it does not auto start on system restart and also pushes with a warning to remove the foreign container, can u suggest me a fix. Thanks in advance.

@Slyke
Copy link
Collaborator

Slyke commented May 2, 2020

Can you paste your docker-compose.yml file?

@devsaumya
Copy link
Author

devsaumya commented May 3, 2020

version: '3.6'
services:

  portainer:
    container_name: portainer
    image: portainer/portainer
    restart: unless-stopped
    ports:
      - 9000:9000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./volumes/portainer/data:/data

  mongodb:
    image: mongo:4.2.3-bionic
    container_name: mongodb
    ports:
      - 27017:27017
    environment:
      - MONGO_INITDB_DATABASE=admin
      - MONGO_INITDB_ROOT_USERNAME=admin
      - MONGO_INITDB_ROOT_PASSWORD=admin
    volumes:
      # seeding scripts
      - ./volumes/mongodb/mongo-entrypoint:/docker-entrypoint-initdb.d
      # named volumes
      - ./volumes/mongodb/mongodb:/data/db
      - ./volumes/mongodb/mongoconfig:/data/configdb

@Slyke
Copy link
Collaborator

Slyke commented May 3, 2020

Hey @DevSaumyadip there's 2 issues here. The first one, the issue that the "container" doesn't start (I'm assuming you mean the mongodb container based off your docker-compose.yml) is hopefully an easy fix. Just put this code right below the line container_name: mongodb

    restart: unless-stopped

Make sure the indentation is correct or it will error.

The second issue is harder to diagnose. Can you copy and paste the exact error message you see, along with the commands you entered in to produce it?

@devsaumya
Copy link
Author

no after adding restart: unless-stopped it does not work also, I think that's a bug with Docker version 19.03.8

docker/for-linux#652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants