Giter Site home page Giter Site logo

Comments (9)

dorinclisu avatar dorinclisu commented on September 14, 2024 3

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.

HongQuan195 avatar HongQuan195 commented on September 14, 2024 1

this node is not a swarm manager. Use "docker swarm init"

Hi @dorinclisu @tiangolo have any suggest for this problem?

from dockerswarm.rocks.

jamesthesken avatar jamesthesken commented on September 14, 2024

Hi @tiangolo , any thoughts?

from dockerswarm.rocks.

jamesthesken avatar jamesthesken commented on September 14, 2024

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.

dorinclisu avatar dorinclisu commented on September 14, 2024
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.

derek-mba avatar derek-mba commented on September 14, 2024

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.

tiangolo avatar tiangolo commented on September 14, 2024

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.

github-actions avatar github-actions commented on September 14, 2024

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.

HongQuan195 avatar HongQuan195 commented on September 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.