test dind

This commit is contained in:
Malte Jürgens 2022-07-23 12:53:43 +02:00
parent bf7c7fa152
commit d2f564faef
No known key found for this signature in database
GPG Key ID: D29FBD5F93C0CFC3
3 changed files with 27 additions and 16 deletions

View File

@ -9,7 +9,7 @@ Build Docker Images:
when: manual
only:
- master
image: ubuntu
image: registry.gitlab.com/librewolf-community/browser/bsys5/dind
services:
- docker:dind
parallel:
@ -25,17 +25,7 @@ Build Docker Images:
- tumbleweed
- macos-x86_64
- macos-aarch64
variables:
DOCKER_HOST: tcp://docker:2375
# Install docker and make
before_script:
- apt-get update
- apt-get install -y ca-certificates curl gnupg lsb-release
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
- apt-get update
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin make
# Build container
- dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.gitlab.com
- make docker-$DISTRO
@ -60,8 +50,7 @@ Build:
- macos-aarch64
variables:
SOURCE_URL: $SOURCE_URL
use_docker: "false"
image: registry.gitlab.com/librewolf-community/browser/bsys5/$DISTRO
image: registry.gitlab.com/librewolf-community/browser/bsys5/dind
tags:
- autoscale
except:

View File

@ -1,4 +1,4 @@
.PHONY : help clean veryclean prune docker push rmi build update work docker-debian11 debian11 docker-mint20 mint20 docker-ubuntu20 ubuntu20 docker-ubuntu21 ubuntu21 docker-ubuntu22 ubuntu22 docker-fedora34 fedora34 docker-fedora35 fedora35 docker-fedora36 fedora36 docker-macos-x86_64 macos-x86_64 docker-macos-aarch64 macos-aarch64 docker-tumbleweed tumbleweed tarball
.PHONY : help clean veryclean prune docker push rmi build update work docker-debian11 debian11 docker-mint20 mint20 docker-ubuntu20 ubuntu20 docker-ubuntu21 ubuntu21 docker-ubuntu22 ubuntu22 docker-fedora34 fedora34 docker-fedora35 fedora35 docker-fedora36 fedora36 docker-macos-x86_64 macos-x86_64 docker-macos-aarch64 macos-aarch64 docker-tumbleweed tumbleweed tarball docker-dind
version:=$(shell cat version)
release:=$(shell cat release)
@ -24,6 +24,7 @@ help :
@echo " [docker-macos-x86_64]"
@echo " [docker-macos-aarch64]"
@echo " [docker-tumbleweed]"
@echo " [docker-dind]"
@echo ""
@echo "build targets:"
@echo " [debian11]"
@ -53,7 +54,7 @@ veryclean : clean
prune :
docker system prune --all --force
docker : docker-debian11 docker-mint20 docker-ubuntu20 docker-ubuntu21 docker-ubuntu22 docker-fedora34 docker-fedora35 docker-fedora36 docker-macos-x86_64 docker-macos-aarch64
docker : docker-debian11 docker-mint20 docker-ubuntu20 docker-ubuntu21 docker-ubuntu22 docker-fedora34 docker-fedora35 docker-fedora36 docker-macos-x86_64 docker-macos-aarch64 docker-dind
build :
${MAKE} clean
@ -89,6 +90,7 @@ push :
docker push registry.gitlab.com/librewolf-community/browser/bsys5/fedora36
docker push registry.gitlab.com/librewolf-community/browser/bsys5/macos-x86_64
docker push registry.gitlab.com/librewolf-community/browser/bsys5/macos-aarch64
docker push registry.gitlab.com/librewolf-community/browser/bsys5/dind
rmi :
docker rmi registry.gitlab.com/librewolf-community/browser/bsys5/debian11
@ -101,6 +103,7 @@ rmi :
docker rmi registry.gitlab.com/librewolf-community/browser/bsys5/fedora36
docker rmi registry.gitlab.com/librewolf-community/browser/bsys5/macos-x86_64
docker rmi registry.gitlab.com/librewolf-community/browser/bsys5/macos-aarch64
docker rmi registry.gitlab.com/librewolf-community/browser/bsys5/dind
update :
@wget -q -O version "https://gitlab.com/librewolf-community/browser/source/-/raw/main/version"
@ -207,3 +210,11 @@ docker-macos-aarch64 :
${MAKE} -f assets/macos.mk arch=aarch64 docker
macos-aarch64 :
${MAKE} -f assets/macos.mk arch=aarch64 build
#
# Docker in Docker (for GitLab CI)
#
docker-dind :
docker build -f assets/dind.Dockerfile -t registry.gitlab.com/librewolf-community/browser/bsys5/dind:latest .

11
assets/dind.Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM ubuntu:jammy
RUN apt-get update &&\
apt-get install -y ca-certificates curl gnupg lsb-release &&\
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg &&\
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null &&\
apt-get update &&\
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin make &&\
apt-get clean
ENV DOCKER_HOST="tcp://docker:2375"