Gitlab CI - docker: command not found

后端 未结 3 1549
太阳男子
太阳男子 2021-01-11 09:23

I am trying to build my docker image within the gitlab ci pipeline.

However it is not able to find the docker command.

/bin/bash: line 69: doc

相关标签:
3条回答
  • 2021-01-11 09:55

    Problem here is that node docker image does not embed docker binaries.

    Two possibilities :

    • split stages to two jobs. One using node images for quality and test, one using docker image for building and deploying. See jobs documentation.

    • build a custom docker image that embed both node and docker and use this image to build your repo.

    Note that in both case you will have to enable docker inside your agent. See documentation.

    0 讨论(0)
  • 2021-01-11 09:57

    additional to Hieu Vo

    image: docker:latest
    
    stages:
      - build
      - release
    
    services:
      - docker:dind
    
    0 讨论(0)
  • 2021-01-11 10:03

    you need to choose an image including docker binaries

    image: gitlab/dind
    
    services:
      - docker:dind
    
    0 讨论(0)
提交回复
热议问题