Initial draft of plugin.
This commit is contained in:
parent
a51b159186
commit
7db99e0fa6
15 changed files with 679 additions and 0 deletions
34
entrypoint.sh
Executable file
34
entrypoint.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
# https://docs.docker.com/reference/cli/dockerd/
|
||||
|
||||
##
|
||||
## build command to execute
|
||||
##
|
||||
|
||||
COMMAND="dockerd --rootless --host=0.0.0.0:${DOCKERD_PORT:-2375} --tls=false --data-root=/woodpecker/docker --shutdown-timeout=${DOCKERD_SHUTDOWN_TIMEOUT:-0} --feature=buildkit=true --feature=containerd-snapshotter=true"
|
||||
if [[ "${DOCKERD_ROOTLESS:-true}" == "true" ]]; then
|
||||
COMMAND+=" "
|
||||
fi
|
||||
if [[ -n "$DOCKERD_LOG_LEVEL" ]]; then
|
||||
COMMAND+=" --log-level=$DOCKERD_LOG_LEVEL"
|
||||
fi
|
||||
if [[ -n "$DOCKERD_REGISTRY_MIRROR" ]]; then
|
||||
COMMAND+=" --registry-mirror=$DOCKERD_REGISTRY_MIRROR"
|
||||
if [[ "$DOCKERD_REGISTRY_MIRROR" =~ ^http:\/\/.*$ ]]; then
|
||||
COMMAND+=" --insecure-registry=${DOCKERD_REGISTRY_MIRROR//http:\/\//}"
|
||||
fi
|
||||
fi
|
||||
if [[ -n "$DOCKERD_INSECURE_REGISTRY" ]]; then
|
||||
COMMAND+=" --insecure-registry=$DOCKERD_INSECURE_REGISTRY"
|
||||
fi
|
||||
|
||||
##
|
||||
## execute command
|
||||
##
|
||||
|
||||
export XDG_RUNTIME_DIR=/woodpecker/docker/runtime
|
||||
COMMAND="rootlesskit --state-dir=/woodpecker/docker/rootlesskit --copy-up=/etc --copy-up=/run --propagation=rslave --disable-host-loopback --net=slirp4netns --slirp4netns-sandbox=auto --slirp4netns-seccomp=auto --port-driver=builtin $COMMAND"
|
||||
echo -e "${COMMAND// --/\\n --}\n"
|
||||
eval "$COMMAND"
|
Loading…
Add table
Add a link
Reference in a new issue