mdubourg001 / glci

🦊 Test your Gitlab CI Pipelines changes locally using Docker.
568 stars 17 forks source link

docker pull fails #34

Closed SuperSandro2000 closed 3 years ago

SuperSandro2000 commented 3 years ago

My user does not have the docker group and I normally run docker with sudo. Might this be the cause of the crash?

---------------------------------------------------------------
Running job "build-image" for stage "build-1"
---------------------------------------------------------------

TypeError: Cannot read property 'indexOf' of undefined
    at Object.module.exports.parseRepositoryTag (/home/user/.config/yarn/global/node_modules/dockerode/lib/util.js:42:25)
    at Docker.pull (/home/user/.config/yarn/global/node_modules/dockerode/lib/docker.js:1411:23)
    at /home/user/.config/yarn/global/node_modules/glci/dist/cli.min.js:637:55
    at new Promise (<anonymous>)
    at main$1 (/home/user/.config/yarn/global/node_modules/glci/dist/cli.min.js:637:15)
✘  - build-image
mdubourg001 commented 3 years ago

Could you provide a copy of your .gitlab-ci.yml file please ?

SuperSandro2000 commented 3 years ago
variables:
  IMAGE: docker-registry.company.com/group/repo/ci

build-image:
  stage: build
  tags:
    - docker-host
  only:
    refs:
      - master
    changes:
      - continuous_integration/Dockerfile
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker build -t "$IMAGE" -f continuous_integration/Dockerfile .
    - docker push "$IMAGE"
mdubourg001 commented 3 years ago

Ok so the issue was that GitLab uses the ruby:2.5 docker image by default if no image is specified, which I did not know. Should be fixed in https://github.com/mdubourg001/glci/releases/tag/v0.4.3.

Thanks for reporting 👌