code-server-docker: allow remote docker setup

This commit is contained in:
aptalca
2020-09-10 17:59:06 -04:00
parent 0cf75cc2b6
commit adef5a73e7
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
This mod adds docker and docker-compose binaries to code-server.
**IMPORTANT NOTE**: For docker access inside code-server, a volume mapping needs to be added for `/var/run/docker.sock:/var/run/docker.sock` in code-server docker run/create/compose.
**IMPORTANT NOTE**: For docker access inside code-server, a volume mapping needs to be added for `/var/run/docker.sock:/var/run/docker.sock` in code-server docker run/create/compose. If you'd like to connect to a remote docker service instead, you don't have to map the docker sock; you can either set an env var for `DOCKER_HOST=remoteaddress` or use the docker cli option `-H`.
In code-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-docker` to enable.
+3 -1
View File
@@ -24,6 +24,8 @@ if [ -S /var/run/docker.sock ]; then
fi
usermod -aG "${DOCKER_NAME}" abc
fi
elif [ -n "$DOCKER_HOST" ]; then
echo "**** /var/run/docker.sock is not mapped, therefore, docker client will only work with a remote docker service ****"
else
echo "**** Please map /var/run/docker.sock or docker won't work inside this container ****"
echo "**** Please map /var/run/docker.sock for access to docker service on host. Alternatively you can manually define a remote host address with the docker cli option -H ****"
fi