#Problems following GitLab CI setup

1 messages · Page 1 of 1 (latest)

bleak bronze
#

I'm following the example given here https://docs.dagger.io/integrations/gitlab

When running the pipeline I get the following error:

! start engine: failed to pull image: failed to run command: exec: "docker": executable file not found in $PATH

I understand what this error means, though I do not know how this should be approached in this scenario. I am presuming the example is correct.

I also tried this (which is my preferred setup if it can work since my dags are written in Go) but has the same issue:

.dagger:
  image: golang:1.23.0-bookworm
  services:
    - docker:${DOCKER_VERSION}-dind
  variables:
    DOCKER_HOST: tcp://docker:2376
    DOCKER_TLS_VERIFY: "1"
    DOCKER_TLS_CERTDIR: "/certs"
    DOCKER_CERT_PATH: "/certs/client"
    DOCKER_DRIVER: overlay2
    DOCKER_VERSION: "20.10.16"
  before_script:
    - curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=/usr/local/bin sh

The following code samples demonstrate how to integrate Dagger with GitLab CI.

grand pawn
#
---
stages:
    - lint
    - test
    - release

.docker:
    image: registry.gitlab.com/your-org/golang:1.21.5-alpine3.17
    services:
        - registry.gitlab.com/your-org/docker-dind/alpine3.19:25.0.2-dind-alpine3.19
    variables:
        DOCKER_HOST: tcp://localhost:2376
        DOCKER_TLS_VERIFY: '1'
        DOCKER_TLS_CERTDIR: /certs
        DOCKER_CERT_PATH: /certs/client
        DOCKER_DRIVER: overlay2
        DOCKER_VERSION: 25.0.2
.dagger:
    extends: [.docker]
    before_script:
        - apk add docker-cli curl git
        - echo -en "$CI_JOB_TOKEN" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
        - cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | sh; cd -; }
        - echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword $CI_JOB_TOKEN" >> .netrc
        - chmod 600 ~/.netrc
        - export GOTOOLCHAIN=local+auto

.auth:
    before_script:
        - echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword $CI_JOB_TOKEN" >> ~/.netrc
        - chmod 600 ~/.netrc

your-daggerized-ci:
    extends: [.dagger]
    stage: lint
    script:
        - dagger call -m my_mod my_function

If it helps, as a reference, this is working in a GitLab setup. It seems that in your case, there's no Docker at all to run onto — check the images that you're using.

bleak bronze
#

Yeah there's no docker on the image, though I followed the example so I'm wondering if I'm wrong or the example is wrong or something else?