mirror of
https://github.com/openziti/ziti.git
synced 2026-10-13 15:51:21 +00:00
Add arm/v8 to list of targeted Docker platforms. (#188)
This commit is contained in:
+17
-12
@@ -31,7 +31,7 @@ the image to a public registry.
|
||||
|
||||
This is taken care of by Docker Desktop if you're building on macOS or Windows,
|
||||
but you'll need to install qemu emulation support and register Arm binaries to
|
||||
run on your (presumably) x88 build host if you are running Docker CE on Linux:
|
||||
run on your (presumably) x86_64 build host if you are running Docker CE on Linux:
|
||||
|
||||
$ sudo dnf install -y qemu-system-arm
|
||||
$ docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
|
||||
@@ -53,21 +53,26 @@ the image to a public registry.
|
||||
|
||||
Run `docker buildx` like this:
|
||||
|
||||
$ ziti_version="0.5.8-2554"
|
||||
$ ziti_version="0.15.3"
|
||||
$ docker buildx build \
|
||||
--platform linux/amd64,linux/arm/v7 \
|
||||
--platform linux/amd64,linux/arm/v7,linux/arm/v8 \
|
||||
--build-arg ZITI_VERSION="${ziti_version}" \
|
||||
-t "netfoundry/ziti-tunnel:${ziti_version}" .
|
||||
|
||||
Note that you'll need to append "--push" to this command to be able to use
|
||||
the image locally.
|
||||
Notes:
|
||||
|
||||
Unfortunately `buildx` doesn't currently support building images directly into
|
||||
the local docker cache. Although the `--load` and `--output=type=docker` options
|
||||
exist, the underlying capability will be implemented in a future docker release
|
||||
(see https://github.com/docker/buildx/issues/59). In the meantime, you'll need
|
||||
to push your image builds (with the `--push` build option) and then pull them to
|
||||
run the image locally when building with `buildx`.
|
||||
- You'll need to append "--push" to this command, and then subsequently pull the
|
||||
image to be able to use the image locally.
|
||||
|
||||
Unfortunately `buildx` doesn't currently support building images directly into
|
||||
the local docker cache. Although the `--load` and `--output=type=docker` options
|
||||
exist, the underlying capability will be implemented in a future docker release
|
||||
(see https://github.com/docker/buildx/issues/59). In the meantime, you'll need
|
||||
to push your image builds (with the `--push` build option) and then pull them to
|
||||
run the image locally when building with `buildx`.
|
||||
|
||||
- The armv8 image uses armv7 (32-bit) ziti executables. The 32-bit compatibility
|
||||
libraries are installed in the image, but your Arm CPU must support 32-bit emulation.
|
||||
|
||||
## References:
|
||||
|
||||
@@ -83,7 +88,7 @@ This build method produces an image for the CPU that is running the build host
|
||||
(typically amd64), and places the resulting image into your local Docker image
|
||||
cache.
|
||||
|
||||
$ ziti_version="0.5.8-2554" \
|
||||
$ ziti_version="0.15.3" \
|
||||
$ docker build \
|
||||
--build-arg ZITI_VERSION="${ziti_version}" \
|
||||
-t "netfoundry/ziti-tunnel:${ziti_version}" .
|
||||
@@ -2,7 +2,7 @@ FROM debian:stable-slim as fetch-ziti-artifacts
|
||||
# This build stage grabs artifacts that are copied into the final image.
|
||||
# It uses the same base as the final image to maximize docker cache hits.
|
||||
|
||||
ARG ZITI_VERSION="0.5.8-2554"
|
||||
ARG ZITI_VERSION="0.15.3"
|
||||
|
||||
ARG ARTIFACTORY_TOKEN
|
||||
ARG ARTIFACTORY_BASE_URL="https://netfoundry.jfrog.io/netfoundry"
|
||||
@@ -28,6 +28,8 @@ FROM debian:stable-slim
|
||||
|
||||
RUN mkdir -p /usr/local/bin /etc/ssl/certs
|
||||
RUN apt-get -q update && apt-get -q install -y --no-install-recommends iptables
|
||||
# Use 32-bit arm binaries on arm64 until we have 64-bit arm builds. This also affects fetch-ziti-bins.sh.
|
||||
RUN if [ "$(uname -m)" = "aarch64" ]; then dpkg --add-architecture armhf; apt update; apt install -y libc6:armhf; fi
|
||||
COPY --from=fetch-ziti-artifacts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
|
||||
COPY --from=fetch-ziti-artifacts /tmp/ziti-tunnel /usr/local/bin
|
||||
COPY --from=fetch-ziti-artifacts /tmp/ziti-enroller /usr/local/bin
|
||||
|
||||
@@ -18,7 +18,7 @@ done
|
||||
host_arch=$(uname -m)
|
||||
case "${host_arch}" in
|
||||
"x86_64") artifact_arch="amd64";;
|
||||
"armv7l") artifact_arch="arm";;
|
||||
"armv7l"|"aarch64") artifact_arch="arm";;
|
||||
*) echo "ERROR: ziti binaries do not exist for architecture ${host_arch}"; exit 1;;
|
||||
esac
|
||||
|
||||
@@ -44,5 +44,7 @@ for exe in "${@}"; do
|
||||
exit 1
|
||||
fi
|
||||
tar -xzf "${exe}.tar.gz"
|
||||
if [ -f "${exe}" ]; then chmod 755 "${exe}"; fi
|
||||
if [ -f "${exe}.exe" ]; then chmod 755 "${exe}.exe"; fi
|
||||
rm "${exe}.tar.gz"
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user