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: docker: command not found ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
.gitlab-ci.yml
stages: - quality - test - build - deploy image: node:8.11.3 services: - mongo - docker:dind before_script: - npm install quality: stage: quality script: - npm run-script lint test: stage: test script: - npm run-script test build: stage: build script: - docker build -t server . deploy: stage: deploy script: - echo "TODO deploy push docker image"
GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application. Docker is an open-source project that allows you to use predefined images to run applications in independent "containers" that are run within a single Linux instance.
GitLab Runner implements a number of executors that can be used to run your build. It determines the environment each job runs in. For example, If I want CI/CD job to run PowerShell commands, I might install GitLab Runner on a server and then register a runner that uses the shell executor.
GitLab Runner can be installed on Linux, macOS and Windows. For our sample project, a small server instance with 1 GB RAM should be enough. In addition, since we will be running with the Docker executor, we also need to have Docker Engine installed.
Docker Runner is a Bamboo feature that allows you to run builds and deployments in a Docker container. This isolates the build process from the rest of the environment it runs in.
you need to choose an image including docker binaries
image: gitlab/dind services: - docker:dind
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With