Running Gitlab-CI and Minio with docker-compose
Generate some random string for minio
< /dev/urandom tr -dc ' 12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c32; echo " "
create docker-compose file
version : " 3.7"
services :
gitlab-runner :
image : gitlab/gitlab-runner:latest
volumes :
- runner-config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
networks :
- gitlab-ci
gitlab-minio :
image : minio/minio:latest
volumes :
- minio-config:/root/.minio
- minio-data:/export
networks :
- gitlab-ci
ports :
- 9005:9000
command :
- server
- /export
environment :
MINIO_ACCESS_KEY : <your fisrt key>
MINIO_SECRET_KEY : <your second key>
volumes :
runner-config :
minio-data :
minio-config :
networks :
gitlab-ci :
name : gitlab-ci
open Minio and create bucket ci-cache
open runner container and execute
gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token < gitlab token> \
--executor docker \
--docker-network-mode=root_gitlab-ci \
--description " My Docker Runner" \
--docker-image " docker:stable" \
--cache-type=s3 \
--cache-path=" " \
--cache-shared=true \
--cache-s3-server-address=gitlab-minio:9000 \
--cache-s3-access-key=< your first key> \
--cache-s3-secret-key=< your second key> \
--cache-s3-bucket-name=ci-cache \
--cache-s3-insecure \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock