feat(Dind): Test dind containers
This commit is contained in:
parent
5acce39a09
commit
a34f3ba24d
@ -0,0 +1,12 @@
|
||||
:sourcedir: ../../../../templates/
|
||||
|
||||
= Docker in Docker
|
||||
|
||||
This template helps to start jobs, that need a docker environment to run.
|
||||
Simply expand from this Template.
|
||||
|
||||
.container scan template
|
||||
[source,yaml]
|
||||
----
|
||||
include::{sourcedir}container/docker-in-docker.gitlab-ci.yml[]
|
||||
----
|
||||
22
templates/container/docker-in-docker.gitlab-ci.yml
Normal file
22
templates/container/docker-in-docker.gitlab-ci.yml
Normal file
@ -0,0 +1,22 @@
|
||||
.docker-in-docker:
|
||||
services:
|
||||
- name: docker:20.10.17-dind
|
||||
command:
|
||||
- "--registry-mirror"
|
||||
- "https://nexus.corp.exxcellent.de:18000"
|
||||
- "--insecure-registry"
|
||||
- "nexus.corp.exxcellent.de:18000"
|
||||
- "--insecure-registry"
|
||||
- "gitlab.exxcellent.de:4567"
|
||||
# explicitly disable tls to avoid docker startup interruption
|
||||
- "--tls=false"
|
||||
alias: docker
|
||||
variables:
|
||||
# Instruct Testcontainers to use the daemon of DinD.
|
||||
DOCKER_HOST: "tcp://docker:2375"
|
||||
# Instruct Docker not to start over TLS.
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
# Improve performance with overlayfs.
|
||||
DOCKER_DRIVER: overlay2
|
||||
# Needed by testcontainers https://www.testcontainers.org/supported_docker_environment/continuous_integration/gitlab_ci/
|
||||
TESTCONTAINERS_HOST_OVERRIDE: "host.docker.internal"
|
||||
@ -1,22 +1,12 @@
|
||||
include:
|
||||
local: "templates/container/docker-in-docker.gitlab-ci.yml"
|
||||
|
||||
stages:
|
||||
- verify
|
||||
|
||||
services:
|
||||
- name: docker:dind
|
||||
# explicitly disable tls to avoid docker startup interruption
|
||||
command: [ "--tls=false" ]
|
||||
alias: docker
|
||||
|
||||
variables:
|
||||
# Instruct Testcontainers to use the daemon of DinD.
|
||||
DOCKER_HOST: "tcp://docker:2375"
|
||||
# Instruct Docker not to start over TLS.
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
# Improve performance with overlayfs.
|
||||
DOCKER_DRIVER: overlay2
|
||||
|
||||
Test-Simple-Dind:
|
||||
image: docker:stable
|
||||
extends: .docker-in-docker
|
||||
stage: verify
|
||||
script:
|
||||
- docker run -t alpine echo test
|
||||
Loading…
Reference in New Issue
Block a user