Skip to content

Commit f278bf7

Browse files
committed
add buildx, deprecate armhf
1 parent 53b4121 commit f278bf7

File tree

3 files changed

+21
-25
lines changed

3 files changed

+21
-25
lines changed

Dockerfile

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ RUN \
2525
mkdir -p \
2626
/root-layer/docker-bins \
2727
/tmp/docker_x86_64 \
28-
/tmp/docker_armv7l \
2928
/tmp/docker_aarch64 && \
3029
curl -fo \
3130
/tmp/docker_x86_64.tgz -L \
@@ -34,13 +33,6 @@ RUN \
3433
/tmp/docker_x86_64.tgz -C \
3534
/tmp/docker_x86_64 --strip-components=1 && \
3635
cp /tmp/docker_x86_64/docker /root-layer/docker-bins/docker_x86_64 && \
37-
curl -fo \
38-
/tmp/docker_armv7l.tgz -L \
39-
"https://download.docker.com/linux/static/stable/armhf/docker-${DOCKER_RELEASE}.tgz" && \
40-
tar xf \
41-
/tmp/docker_armv7l.tgz -C \
42-
/tmp/docker_armv7l --strip-components=1 && \
43-
cp /tmp/docker_armv7l/docker /root-layer/docker-bins/docker_armv7l && \
4436
curl -fo \
4537
/tmp/docker_aarch64.tgz -L \
4638
"https://download.docker.com/linux/static/stable/aarch64/docker-${DOCKER_RELEASE}.tgz" && \
@@ -52,9 +44,6 @@ RUN \
5244
curl -fo \
5345
/root-layer/docker-bins/docker-compose_x86_64 -L \
5446
"https://github.com/docker/compose/releases/download/v${COMPOSE_RELEASE}/docker-compose-linux-x86_64" && \
55-
curl -fo \
56-
/root-layer/docker-bins/docker-compose_armv7l -L \
57-
"https://github.com/docker/compose/releases/download/v${COMPOSE_RELEASE}/docker-compose-linux-armv7" && \
5847
curl -fo \
5948
/root-layer/docker-bins/docker-compose_aarch64 -L \
6049
"https://github.com/docker/compose/releases/download/v${COMPOSE_RELEASE}/docker-compose-linux-aarch64" && \
@@ -71,16 +60,18 @@ RUN \
7160
curl -fo \
7261
/root-layer/docker-bins/compose-switch_aarch64 -L \
7362
"https://github.com/docker/compose-switch/releases/download/v${SWITCH_RELEASE}/docker-compose-linux-arm64" && \
74-
echo "**** compile compose switch on armhf ****" && \
63+
echo "**** retrieve latest buildx version ****" && \
64+
if [ -z ${BUILDX_RELEASE+x} ]; then \
65+
BUILDX_RELEASE=$(curl -sX GET "https://api.github.com/repos/docker/buildx/releases/latest" \
66+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
67+
fi && \
68+
echo "**** grab buildx plugin ****" && \
7569
curl -fo \
76-
/tmp/compose-switch.tar.gz -L \
77-
"https://github.com/docker/compose-switch/archive/refs/tags/v${SWITCH_RELEASE}.tar.gz" && \
78-
mkdir -p /tmp/compose-switch && \
79-
tar xf \
80-
/tmp/compose-switch.tar.gz -C \
81-
/tmp/compose-switch --strip-components=1 && \
82-
cd /tmp/compose-switch && \
83-
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags="-s -w -X github.com/docker/compose-switch/internal.Version=${SWITCH_RELEASE}" -o /root-layer/docker-bins/compose-switch_armv7l ./main.go && \
70+
/root-layer/docker-bins/buildx_x86_64 -L \
71+
"https://github.com/docker/buildx/releases/download/${BUILDX_RELEASE}/buildx-${BUILDX_RELEASE}.linux-amd64" && \
72+
curl -fo \
73+
/root-layer/docker-bins/buildx_aarch64 -L \
74+
"https://github.com/docker/buildx/releases/download/${BUILDX_RELEASE}/buildx-${BUILDX_RELEASE}.linux-arm64" && \
8475
chmod +x /root-layer/docker-bins/* && \
8576
rm -rf /tmp/*
8677

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Docker - Docker mod for all images
22

3-
This mod adds `docker` and `docker-compose` binaries to any linuxserver image.
3+
This mod adds the `docker` binary as wells as the `buildx` and the `compose` plug-ins to any linuxserver image.
44

55
**IMPORTANT NOTE**: For docker access inside a container, a volume mapping needs to be added for `/var/run/docker.sock:/var/run/docker.sock:ro` in the container's 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`.
66

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,35 @@
22

33
echo "**** installing docker and docker compose ****"
44
ARCH=$(uname -m)
5-
if [ -d "/docker-bins" ] ; then
5+
if [[ "${ARCH}" = "armv7l" ]]; then
6+
echo "**** The universal docker mod no longer supports arm32v7/armhf per https://info.linuxserver.io/issues/2023-07-01-armhf/ ****"
7+
exit 0
8+
fi
9+
if [[ -d "/docker-bins" ]] ; then
610
echo "Copying over docker and docker-compose binaries"
711
mkdir -p /usr/local/lib/docker/cli-plugins
812
mv "/docker-bins/docker-compose_${ARCH}" /usr/local/lib/docker/cli-plugins/docker-compose
13+
mv "/docker-bins/buildx_${ARCH}" /usr/local/lib/docker/cli-plugins/docker-buildx
914
mv "/docker-bins/docker_${ARCH}" /usr/local/bin/docker
1015
mv "/docker-bins/compose-switch_${ARCH}" /usr/local/bin/docker-compose
1116
rm -rf /docker-bins
1217
else
1318
echo "**** docker and docker-compose already installed, skipping ****"
1419
fi
1520

16-
if [ -S /var/run/docker.sock ]; then
21+
if [[ -S /var/run/docker.sock ]]; then
1722
DOCKER_GID=$(stat -c '%g' "/var/run/docker.sock")
1823
if id -G abc | grep -qw "$DOCKER_GID"; then
1924
exit 0
2025
else
2126
DOCKER_NAME=$(getent group "${DOCKER_GID}" | awk -F: '{print $1}')
22-
if [ -z "${DOCKER_NAME}" ]; then
27+
if [[ -z "${DOCKER_NAME}" ]]; then
2328
DOCKER_NAME="dockergroup"
2429
groupadd -g "${DOCKER_GID}" "${DOCKER_NAME}"
2530
fi
2631
usermod -aG "${DOCKER_NAME}" abc
2732
fi
28-
elif [ -n "$DOCKER_HOST" ]; then
33+
elif [[ -n "$DOCKER_HOST" ]]; then
2934
echo "**** Remote docker service $DOCKER_HOST will be used ****"
3035
else
3136
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 ****"

0 commit comments

Comments
 (0)