Mouradif
Mouradif

Reputation: 2714

Docker container keeps coming back

I have installed gitlab-ce on my server with the following docker.compose.yml :

gitlab:
  image: 'gitlab/gitlab-ce:latest'
  hostname: 'gitlab.devhunt.eu'
  restart: 'always'
  environment:
    # ...
  volumes:
    - '/var/lib/gitlab/config:/etc/gitlab'
    - '/var/lib/gitlab/logs:/var/log/gitlab'
    - '/var/lib/gitlab/data:/var/opt/gitlab'

I used it for a while and now I want to remove it. I noticed that when I did docker stop gitlab (which is the container name), it kept coming back so I figured it was because of the restart: always. Thus the struggle begins :

I would stop the docker daemon but I have production websites and databases running and I would like to avoid downtime if possible. Any idea what I can do ?

Upvotes: 2

Views: 2465

Answers (1)

user9124444
user9124444

Reputation:

you-ve set the restart policy to always, set it to unless-stoped.

check the docs https://docs.docker.com/config/containers/start-containers-automatically/

Upvotes: 1

Related Questions