forked from theohbrothers/docker-code-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.sh
27 lines (25 loc) · 920 Bytes
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -eu
# See: https://github.com/docker-library/official-images#consistency
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
set -- code-server "$@"
fi
if [ "$1" = 'code-server' ]; then
# Start rootless docker
# See: https://github.com/moby/moby/blob/v20.10.22/contrib/dockerd-rootless.sh
# See: https://github.com/docker-library/docker/blob/master/20.10/dind/dockerd-entrypoint.sh
echo "Starting rootless dockerd"
rootlesskit \
--net="${DOCKERD_ROOTLESS_ROOTLESSKIT_NET:-vpnkit}" \
--mtu="${DOCKERD_ROOTLESS_ROOTLESSKIT_MTU:-1500}" \
--disable-host-loopback \
--port-driver="${DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER:-builtin}" \
--copy-up=/etc \
--copy-up=/run \
--propagation=rslave \
${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} \
dockerd &
echo "Starting code-server"
exec code-server "$@"
fi
exec "$@"