Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Running alternative Docker daemon on the same host
#! /bin/bash
# References:
# -
# -
# First you need to have Docker 18.09+ and the bridge-utils package installed.
: ${bridge=altdocker0}
: ${base=$ROOT/$bridge}
if ! ip link show $bridge > /dev/null 2>&1
brctl addbr $bridge
ip addr add ${net:-""} dev $bridge
ip link set dev $bridge up
# NOTE: "--config-file" must be specified to avoid conflicts with system Docker.
dockerd \
--exec-root=$ROOT/docker/run \
--data-root=$ROOT/docker/data \
--config-file=$ROOT/docker/etc/daemon.json \
--storage-driver=overlay2 \
--bridge=altdocker0 \
--host=unix://$ROOT/docker.sock \
# To use this Docker daemon,
# DOCKER_HOST=unix:///opt/altdocker/docker.sock docker run --rm -it alpine:3.8 sh -c "hello world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.