Comments (9)
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.
from dockerswarm.rocks.
this node is not a swarm manager. Use "docker swarm init"
Hi @dorinclisu @tiangolo have any suggest for this problem?
from dockerswarm.rocks.
Hi @tiangolo , any thoughts?
from dockerswarm.rocks.
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/
from dockerswarm.rocks.
services:
- docker:19.03.12-dind
This is the service I'm talking about, defined in your .gitlab-ci.yml
. Delete that.
from dockerswarm.rocks.
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.
from dockerswarm.rocks.
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/ 🥲
from dockerswarm.rocks.
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
from dockerswarm.rocks.
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:
- docker info
- docker --version
stages:
- build
- deploy
include:
- script/ci-build.yml
- script/ci-staging.yml
script/ci-build.yml
BUILD:
stage: build
image: docker:dind
tags:
- gcp
- aai
before_script:
- echo "$DOCKER_REGISTRY_PASSWORD" | docker login $DOCKER_REGISTRY_URL --username $DOCKER_REGISTRY_USER --password-stdin
script:
- export CONTAINER_IMAGE=$DOCKER_REGISTRY_URL/$DOCKER_IMAGE_NAME:$IMAGE_TAG
- docker build -t $CONTAINER_IMAGE .
- docker image push $CONTAINER_IMAGE
- docker rmi $CONTAINER_IMAGE
only:
- fix-runner-gitlab-ci
script/ci-staging.yml
STA - DEPLOY:
stage: deploy
image: docker:dind
tags:
- gcp
before_script:
- apk add curl
- apk add gettext
variables:
NETWORK: public
script:
- echo $IMAGE_TAG
- envsubst < ./script/stack.yml > ./deploy-content.yml
- content_with_backslash=$(awk '{printf "%s\n", $0}' deploy-content.yml)
- printf "%s" "$content_with_backslash"
- |
curl -kvv --fail-with-body --location --request PUT 'https://abc'
--header "x-api-key: $DEPLOYMENT_TOKEN_STAGING"
--header "Content-Type: application/json"
--data "{
"prune": true,
"pullImage": true,
"stackFileContent": "$content_with_backslash"
}"
only:
- fix-runner-gitlab-ci
from dockerswarm.rocks.
Related Issues (20)
- Swarmpit setup fails - http://db:5984 host unreachable HOT 4
- Service placement on different node makes it unreachable HOT 2
- Swarmpit on ARM HOT 1
- Let's encrypt issue HOT 2
- Setting up hostname didn't work
- 404 for grafana / prometheus requests HOT 2
- Traefik example and its labels HOT 1
- Suggestion: Start with simple stack to get Portainer running with Caddy HOT 2
- Traefik on 2 Manager Nodes HOT 4
- What are the things to look when traefik.<domain name> is not loading? HOT 2
- Any recommended FOSS projects for Docker Swarm Mode deployments? HOT 3
- Traefik : redirect all http to https HOT 4
- n/a
- nginx loadbalancer
- Custom SSL Certificate HOT 3
- [feature request] dark mode for dockerswarm.rocks HOT 1
- Traefik redundancy and DNS configuration HOT 3
- Feature Request: Explain the roles of Portainer and Swarmpit (better) HOT 1
- Is dockerswarm.rocks still maintained? HOT 14
- Everything depends on the first node despite being in swarm mode HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerswarm.rocks.