github.com/duglin/docker@v1.13.1/hack/make/run (about)

     1  #!/bin/bash
     2  
     3  set -e
     4  rm -rf "$DEST"
     5  
     6  if ! command -v dockerd &> /dev/null; then
     7  	echo >&2 'error: binary-daemon or dynbinary-daemon must be run before run'
     8  	false
     9  fi
    10  
    11  DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
    12  DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
    13  
    14  # example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
    15  storage_params=""
    16  if [ -n "$DOCKER_STORAGE_OPTS" ]; then
    17  	IFS=','
    18  	for i in ${DOCKER_STORAGE_OPTS}; do
    19  		storage_params="--storage-opt $i $storage_params"
    20  	done
    21  	unset IFS
    22  fi
    23  
    24  
    25  listen_port=2375
    26  if [ -n "$DOCKER_PORT" ]; then
    27  	IFS=':' read -r -a ports <<< "$DOCKER_PORT"
    28  	listen_port="${ports[-1]}"
    29  fi
    30  
    31  extra_params=""
    32  if [ "$DOCKER_REMAP_ROOT" ]; then
    33  	extra_params="--userns-remap $DOCKER_REMAP_ROOT"
    34  fi
    35  
    36  args="--debug \
    37  	--host tcp://0.0.0.0:${listen_port} --host unix:///var/run/docker.sock \
    38  	--storage-driver "$DOCKER_GRAPHDRIVER" \
    39  	--userland-proxy="$DOCKER_USERLANDPROXY" \
    40  	$storage_params \
    41  	$extra_params"
    42  
    43  echo dockerd $args
    44  exec dockerd $args