mirror of
https://github.com/dangeroustech/ZeroTierBridge.git
synced 2025-12-06 00:56:58 +00:00
chore: enhance Dockerfile architecture detection for ZeroTier installation
- Improved architecture detection logic to support additional ARM variants (armhf, armv7). - Added error handling for unsupported architectures. - Updated download command to provide clearer output during the installation process. No functional changes intended; enhances robustness and maintainability of the Dockerfile.
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -5,8 +5,17 @@ ARG VERSION=1.12.2
|
|||||||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends -y \
|
RUN apt-get update -qq && apt-get install -qq --no-install-recommends -y \
|
||||||
ca-certificates=20230311+deb12u1 \
|
ca-certificates=20230311+deb12u1 \
|
||||||
curl=7.88.1-10+deb12u14
|
curl=7.88.1-10+deb12u14
|
||||||
RUN ARCH_MAPPING=$([ "$TARGETARCH" = "amd64" ] && echo amd64 || ([ "$TARGETARCH" = "arm64" ] && echo arm64 || echo "$TARGETARCH")) \
|
RUN set -e; \
|
||||||
&& curl -sSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${ARCH_MAPPING}.deb"
|
DETECTED_ARCH="${TARGETARCH:-}"; \
|
||||||
|
if [ -z "$DETECTED_ARCH" ]; then DETECTED_ARCH="$(dpkg --print-architecture)"; fi; \
|
||||||
|
case "$DETECTED_ARCH" in \
|
||||||
|
amd64|x86_64) ARCH_MAPPING=amd64 ;; \
|
||||||
|
arm64|aarch64) ARCH_MAPPING=arm64 ;; \
|
||||||
|
armhf|armv7*) ARCH_MAPPING=armhf ;; \
|
||||||
|
*) echo "Unsupported architecture: $DETECTED_ARCH" >&2; exit 1 ;; \
|
||||||
|
esac; \
|
||||||
|
echo "Downloading ZeroTier: arch=$ARCH_MAPPING version=$VERSION"; \
|
||||||
|
curl -fsSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${ARCH_MAPPING}.deb"
|
||||||
|
|
||||||
FROM debian:12.6
|
FROM debian:12.6
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
|||||||
Reference in New Issue
Block a user