Commit fca216d3 authored by Nicolas Vuillermet's avatar Nicolas Vuillermet

Create Docker in Docker container based on Alpine

parent 43ead5da
---
image: docker:stable
variables:
IMAGE: $DOCKER_REGISTRY/outils-admins/cli-dind
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
stages:
- build
- test
- push
services:
- docker:18-dind
Build docker image:
stage: build
before_script: &before_script
- docker login $DOCKER_REGISTRY -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD
script:
- docker build -t $IMAGE:$CI_COMMIT_SHA .
- docker push $IMAGE:$CI_COMMIT_SHA
Push image:
stage: push
before_script: *before_script
script:
- docker pull $IMAGE:$CI_COMMIT_SHA
- docker tag $IMAGE:$CI_COMMIT_SHA $IMAGE:latest
- docker push $IMAGE:latest
FROM alpine:3.7
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/latest-stable/community' >> /etc/apk/repositories \
apk update
RUN apk add docker \
rc-update add docker boot \
service docker start
RUN apk add py-pip \
apk add python-dev libffi-dev openssl-dev gcc libc-dev make \
pip install docker-compose
ENTRYPOINT []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment