I have registered gitlab-runner with the following command:
gitlab-runner register --non-interactive \
--url ${URL} \
--registration-token ${REGISTRATION_TOKEN} \
--description ${RUNNER_NAME} \
--tag-list ${TAGS} \
--executor "docker" \
--docker-image="docker:stable" \
--docker-pull-policy if-not-present \
--locked=false \
--docker-privileged=true \
--docker-volumes=["/var/run/docker.sock:/var/run/docker.sock", "/cache"] \
There is my runner config:
[[runners]]
name = "XXX"
url = "XXX"
id = 19981753
token = "XXX"
token_obtained_at = 2022-12-24T11:43:10Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
pull_policy = ["if-not-present"]
shm_size = 0
Then I am trying to run ci with docker-compose, but there is an error: docker-compose: not found:
There is a part from my .gitlab-ci.yml:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
stages:
- build
- staging
- release
- deploy
build:
stage: build
script:
- echo "IMAGE_APP_TAG=$STAGE_IMAGE_APP_TAG" >> .env
- docker-compose build
- docker-compose push
only:
- dev
- main
Which image for docker executor should i use to run docker-compose? Should i change .gitlac-ci.yml or gitlab-runner config.toml?
CodePudding user response:
In the buid job, just add the docker compose image
build:
image: docker/compose
Or you can use any other image and install the docker compose by yourself.