mirror of
https://github.com/N0rthernL1ghts/bbk-docker.git
synced 2024-11-23 03:01:08 +01:00
Add support for multi-arch
Platforms: - linux/i386 - linux/amd64 - linux/armhf - linux/aarch64
This commit is contained in:
parent
512aea9c79
commit
6e76c8b7c6
17
Dockerfile
17
Dockerfile
|
@ -1,14 +1,23 @@
|
|||
ARG BBKCLI_VERSION=1.0
|
||||
FROM scratch AS bbkcli
|
||||
|
||||
FROM --platform=${TARGETPLATFORM} alpine:3.16 AS bbkcli
|
||||
|
||||
# See: http://www.bredbandskollen.se/bredbandskollen-cli/
|
||||
ARG BBKCLI_VERSION
|
||||
ADD ["https://frontend.bredbandskollen.se/download/bbk_cli_linux_amd64-${BBKCLI_VERSION}", "/bbk_cli"]
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
RUN case ${TARGETPLATFORM} in \
|
||||
"linux/amd64") BBKCLI_ARCH=amd64 ;; \
|
||||
"linux/arm64") BBKCLI_ARCH=aarch64 ;; \
|
||||
"linux/arm/v7") BBKCLI_ARCH=armhf ;; \
|
||||
"linux/386") BBKCLI_ARCH=i386 ;; \
|
||||
esac \
|
||||
&& wget -q https://frontend.bredbandskollen.se/download/bbk_cli_linux_${BBKCLI_ARCH:-amd64}-${BBKCLI_VERSION} -O /bbk_cli
|
||||
|
||||
|
||||
|
||||
# Main image
|
||||
FROM alpine:3.16
|
||||
FROM --platform=${TARGETPLATFORM} alpine:3.16
|
||||
|
||||
LABEL net.northern-lights.image.authors="aleksandar@puharic.com"
|
||||
LABEL net.northern-lights.image.version="${BBKCLI_VERSION}"
|
||||
|
@ -20,5 +29,7 @@ RUN apk add --update --no-cache gcompat libstdc++ tzdata \
|
|||
COPY --from=bbkcli --chmod=0775 ["/bbk_cli", "/usr/local/bin/"]
|
||||
|
||||
ARG BBKCLI_VERSION
|
||||
ARG TARGETPLATFORM
|
||||
ENV BBKCLI_VERSION=${BBKCLI_VERSION}
|
||||
ENV PLATFORM_ARCH=${TARGETPLATFORM}
|
||||
ENV TZ=Europe/Stockholm
|
||||
|
|
|
@ -7,7 +7,7 @@ target "build-dockerfile" {
|
|||
}
|
||||
|
||||
target "build-platforms" {
|
||||
platforms = ["linux/amd64"]
|
||||
platforms = ["linux/i386", "linux/amd64", "linux/armhf", "linux/aarch64"]
|
||||
}
|
||||
|
||||
target "build-common" {
|
||||
|
|
Loading…
Reference in New Issue
Block a user