Closed jamesthesken closed 9 months ago
Hi @tiangolo , any thoughts?
The CI config uses the docker-in-docker service (docker:19.03.12-dind), which is highly recommended against BTW.
What it means in your case is that any docker commands will get serviced by the inner docker daemon, which is independent and has nothing to do with the outer daemon (the swarm master), hence the error.
If you installed the runner per instructions (and /var/run/docker.sock is bind mounted) then you should simply remove the dind service from the CI yaml and it will probably work.
Hey @dorinclisu thank you for your reply, I was feeling like I couldn't get past this hurdle. I'll give that a try and report back.
Which CI yaml are you referring to? I don't see docker-in-docker service on this page: https://dockerswarm.rocks/gitlab-ci/
services:
- docker:19.03.12-dind
This is the service I'm talking about, defined in your .gitlab-ci.yml
. Delete that.
The CI config uses the docker-in-docker service (docker:19.03.12-dind), which is highly recommended against BTW.
Unfortunately, it is not "highly recommended against" by GitLab
If you installed the runner per instructions (and /var/run/docker.sock is bind mounted) then you should simply remove the dind service from the CI yaml and it will probably work.
If you installed the runner "per instructions" you probably are running the docker-in-docker service! It does mention socket binding, but there's a note "If you bind the Docker socket and you are using GitLab Runner 11.11 or later, you can no longer use docker:20.10.16-dind as a service.", which seems to imply this is a bad thing. Having now read your reference, I can see I have zero need for the dind service, but I sure wish GitLab would make that clear.
Thanks for the patience!
I should let you know, that I had to deprecate this website and ideas, I would no longer recommend Docker Swarm Mode for new projects: https://dockerswarm.rocks/swarm-or-kubernetes/ 🥲
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
have same issue. here is my ci pipeline. Build stage is fine but deploy get issue related to swarm master node. I remove services as [dorinclisu] recommend but still not working. It stuck in curl -kvv step .gitlab-ci.yml
variables:
before_script:
stages:
include:
script/ci-build.yml
BUILD: stage: build image: docker:dind tags:
script/ci-staging.yml STA - DEPLOY: stage: deploy image: docker:dind tags:
this node is not a swarm manager. Use "docker swarm init"
Hi @dorinclisu @tiangolo have any suggest for this problem?
Hi @tiangolo thank you for this guide, I've gotten a lot better at Docker configurations since reading it!
On the page, GitLab CI runner for CI/CD, I can't get the deploy stage to work for my stack. The build stage works fine, however I receive the error:
My
.gitlab-ci.yml
:Would it help by using your image,
tiangolo/docker-with-compose
? Thank you for your help.