Git Product home page Git Product logo

dind's Introduction

Docker In Docker with Builx and IPv6

Some times Docker in Docker is require for more organization or one time runs such as build container with Gitlab-ci. Regular dind is not support buildx and IPv6. This repository aim that these kind a problems.

This dind is require privileged mode.

To enable buildx, set env variable buildx is to yes.
If main docker is configured with IPv6, dind container has a IPv6 detection system and system try to find and set IPv6.
You can set IPv6 by manual with set ipv6 env variable to your IPv6 block

Before build command start docker service with /src/start-docker.sh

Example gitlab-ci.yml from some project.

docker-build:
    variables:
      buildx: "yes"
    image: ahmetozer/dind:latest
    stage: build
    before_script:
      - /src/start-docker.sh
      - docker login -u "ahmetozer" -p "$dhub"
    script:
      - docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push -t ahmetozer/cors-proxy .
    only:
      - master

Overlay layer is more optimized for performance and disk space. So you can run your dind with mounting docker lib path to real ext4 path on disk.

#   Create directory for your dind containers
mkdir -p /dind/dind1

docker run -it --rm --privileged -v /dind/dind1:/var/lib/docker ahmetozer/dind

Example gitlab-runner config.

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800
  listen_address = "[::]:8093"

[[runners]]
  name = "dind1"
  url = "https://gitlab.com/"
  token = "My_SECRET_TOKEN"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.docker]
    tls_verify = false
    image = "alpine:latest"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache","/var/lib/docker/dind-overlay:/var/lib/docker:rw"]
    shm_size = 0

dind's People

Contributors

ahmetozer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.