Reputation: 2714
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 :
docker update --restart=no gitlab
before docker stop gitlab
. Still coming back.docker stop gitlab && docker rm gitlab
. It got deleted but came back soon afterdocker-compose.yml
to restart: no
, did docker-compose down
. The container got stopped and deleted but came back soon afterdocker-compose up
to apply the change in the compose file, checked that it was successfully taken into account with docker inspect -f "{{ .HostConfig.RestartPolicy }}" gitlab
. The response was {no 0}
. I did docker-compose down
. Again, it got stopped and deleted but came back soon afterdocker stop gitlab && docker rm gitlab && docker image rm fcc1e4187c43
(the image hash I had for docker-ce). The container got stopped, deleted and the image got deleted. And it seemed that I had finally managed to kill the beast... one hour later, gitlab container was reinstalled with another image hash (3cc8e8a0764d
) and the container was starting.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
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