Skip to content
The official Docker Docker-in-Docker image, with an option to pass CLI options as an environment variable.
Branch: master
Clone or download
Pull request Compare This branch is 2 commits behind LordGaav:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
LICENSE.md
README.md
dind-opts.sh

README.md

dind-options Docker Image

A slightly modified version of the official Docker-in-Docker image (specifically the docker:dind image), allowing arguments to its entrypoint to be passed as an environment variable.

My main issue was that when using the official image as a Gitlab CI service, I am unable to pass any CLI options. Because I use a Docker registry with a self-signed certificate, I need to pass --insecure-registry to dind during startup.

As such, I added a small wrapper entrypoint that adds the contents of the DOCKER_OPTS environment variable to the CLI arguments of the normal entrypoint.

This allows me to do this in Gitlab CI:

image: docker:latest

variables:
    DOCKER_OPTS: "--insecure-registry=my.docker.registry"
    DOCKER_HOST: "tcp://lordgaav__dind-options:2375"

services:
    - lordgaav/dind-options:latest

License

Released under the MIT license.

You can’t perform that action at this time.