Skip to content

Commit 2355e67

Browse files
authored
Merge pull request #476 from linuxserver/universal-docker-s6v3
switch to hybrid (universal-docker)
2 parents fd22798 + 61c81bb commit 2355e67

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-universal-docker-setup/dependencies.d/init-mods

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
echo "**** installing docker and docker compose ****"
4+
ARCH=$(uname -m)
5+
if [ -d "/docker-bins" ] ; then
6+
echo "Copying over docker and docker-compose binaries"
7+
mkdir -p /usr/local/lib/docker/cli-plugins
8+
mv "/docker-bins/docker-compose_${ARCH}" /usr/local/lib/docker/cli-plugins/docker-compose
9+
mv "/docker-bins/docker_${ARCH}" /usr/local/bin/docker
10+
mv "/docker-bins/compose-switch_${ARCH}" /usr/local/bin/docker-compose
11+
rm -rf /docker-bins
12+
else
13+
echo "**** docker and docker-compose already installed, skipping ****"
14+
fi
15+
16+
if [ -S /var/run/docker.sock ]; then
17+
DOCKER_GID=$(stat -c '%g' "/var/run/docker.sock")
18+
if id -G abc | grep -qw "$DOCKER_GID"; then
19+
exit 0
20+
else
21+
DOCKER_NAME=$(getent group "${DOCKER_GID}" | awk -F: '{print $1}')
22+
if [ -z "${DOCKER_NAME}" ]; then
23+
DOCKER_NAME="dockergroup"
24+
groupadd -g "${DOCKER_GID}" "${DOCKER_NAME}"
25+
fi
26+
usermod -aG "${DOCKER_NAME}" abc
27+
fi
28+
elif [ -n "$DOCKER_HOST" ]; then
29+
echo "**** Remote docker service $DOCKER_HOST will be used ****"
30+
else
31+
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 ****"
32+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oneshot
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mod-universal-docker-setup/run

root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-universal-docker-setup

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-universal-docker-setup

Whitespace-only changes.

0 commit comments

Comments
 (0)