Last active
September 4, 2024 14:11
-
-
Save bkuhl/3487ec4557eee8de6700d6a0ab058e72 to your computer and use it in GitHub Desktop.
How to use docker-compose in GitLab CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using edge-git ensures we're always pulling the latest | |
# You can lock into a specific version using the *-git tags | |
# on https://hub.docker.com/_/docker/ | |
image: docker:edge-git | |
services: | |
- docker:dind | |
# If you only need compose in a specific step definitely put this | |
# only in that step so it's not executed unnecessarily | |
before_script: | |
- apk add --no-cache py2-pip && pip install docker-compose |
I was getting same issue. This fixed,
- Use
shell
executor - Make sure you have installed docker & docker-compose.
- Allow gitlab-runner to access docker with
usermod -a -G docker gitlab-runner
in your server
Everything should work now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which executor it's better to build with docker-compose?
Enter an executor: parallels, shell, virtualbox, docker+machine, docker-ssh+machine, custom, docker, kubernetes, docker-ssh, ssh
I tried with docker:latest