Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save debuglevel/68c2f63a46d46824e2996139df98637b to your computer and use it in GitHub Desktop.
Save debuglevel/68c2f63a46d46824e2996139df98637b to your computer and use it in GitHub Desktop.
Using a self signed certificate for docker repository in GitLab
image: docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# from https://gitlab.com/gitlab-org/gitlab-runner/issues/1350
services:
- name: docker:dind
command:
- /bin/sh
- -c
- wget http://MYSERVER/MYCOMPANY.crt -O /usr/local/share/ca-certificates/MYCOMPANY.crt && update-ca-certificates && dockerd-entrypoint.sh || exit
stages:
- build
docker-image:
stage: build
script:
- docker login MYREGISTRY:5000 -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD
- docker build -t MYREGISTRY:5000/collectd-server .
- docker push MYREGISTRY:5000/collectd-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment