-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Alpine 3.19/Go 1.22/CoreDNS 1.8.7 (#129)
- Loading branch information
Showing
5 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,51 @@ | ||
ARG BUILD_FROM | ||
|
||
FROM --platform=amd64 golang:1.15-alpine3.13 AS builder | ||
|
||
WORKDIR /usr/src | ||
ARG BUILD_ARCH | ||
ARG COREDNS_VERSION | ||
|
||
# Build CoreDNS | ||
COPY plugins plugins | ||
RUN \ | ||
set -x \ | ||
&& apk add --no-cache \ | ||
git \ | ||
make \ | ||
bash \ | ||
&& git clone --depth 1 -b v${COREDNS_VERSION} https://github.com/coredns/coredns \ | ||
&& cp -rf plugins/* coredns/plugin/ \ | ||
&& cd coredns \ | ||
&& sed -i "/^template:template/d" plugin.cfg \ | ||
&& sed -i "/^hosts:.*/a template:template" plugin.cfg \ | ||
&& sed -i "/^forward:.*/i fallback:fallback" plugin.cfg \ | ||
&& sed -i "/^hosts:.*/a mdns:mdns" plugin.cfg \ | ||
&& sed -i "/route53:route53/d" plugin.cfg \ | ||
&& sed -i "/clouddns:clouddns/d" plugin.cfg \ | ||
&& sed -i "/k8s_external:k8s_external/d" plugin.cfg \ | ||
&& sed -i "/kubernetes:kubernetes/d" plugin.cfg \ | ||
&& sed -i "/etcd:etcd/d" plugin.cfg \ | ||
&& sed -i "/grpc:grpc/d" plugin.cfg \ | ||
&& go generate \ | ||
&& \ | ||
if [ "${BUILD_ARCH}" = "armhf" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=6 GOARCH=arm"; \ | ||
elif [ "${BUILD_ARCH}" = "armv7" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=7 GOARCH=arm"; \ | ||
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=arm64"; \ | ||
elif [ "${BUILD_ARCH}" = "i386" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=386"; \ | ||
elif [ "${BUILD_ARCH}" = "amd64" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=amd64"; \ | ||
else \ | ||
exit 1; \ | ||
fi | ||
|
||
FROM ${BUILD_FROM} | ||
|
||
WORKDIR /config | ||
COPY --from=builder /usr/src/coredns/coredns /usr/bin/coredns | ||
COPY rootfs / | ||
ARG BUILD_FROM | ||
|
||
FROM --platform=amd64 golang:1.22-alpine3.19 AS builder | ||
|
||
WORKDIR /usr/src | ||
ARG BUILD_ARCH | ||
ARG COREDNS_VERSION | ||
|
||
# Build CoreDNS | ||
COPY plugins plugins | ||
RUN \ | ||
set -x \ | ||
&& apk add --no-cache \ | ||
git \ | ||
make \ | ||
bash \ | ||
&& git clone --depth 1 -b v${COREDNS_VERSION} https://github.com/coredns/coredns \ | ||
&& cp -rf plugins/* coredns/plugin/ \ | ||
&& cd coredns \ | ||
&& sed -i "/^template:template/d" plugin.cfg \ | ||
&& sed -i "/^hosts:.*/a template:template" plugin.cfg \ | ||
&& sed -i "/^forward:.*/i fallback:fallback" plugin.cfg \ | ||
&& sed -i "/^hosts:.*/a mdns:mdns" plugin.cfg \ | ||
&& sed -i "/route53:route53/d" plugin.cfg \ | ||
&& sed -i "/clouddns:clouddns/d" plugin.cfg \ | ||
&& sed -i "/k8s_external:k8s_external/d" plugin.cfg \ | ||
&& sed -i "/kubernetes:kubernetes/d" plugin.cfg \ | ||
&& sed -i "/etcd:etcd/d" plugin.cfg \ | ||
&& sed -i "/grpc:grpc/d" plugin.cfg \ | ||
&& go mod tidy \ | ||
&& go generate \ | ||
&& \ | ||
if [ "${BUILD_ARCH}" = "armhf" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=6 GOARCH=arm"; \ | ||
elif [ "${BUILD_ARCH}" = "armv7" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=7 GOARCH=arm"; \ | ||
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=arm64"; \ | ||
elif [ "${BUILD_ARCH}" = "i386" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=386"; \ | ||
elif [ "${BUILD_ARCH}" = "amd64" ]; then \ | ||
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=amd64"; \ | ||
else \ | ||
exit 1; \ | ||
fi | ||
|
||
FROM ${BUILD_FROM} | ||
|
||
WORKDIR /config | ||
COPY --from=builder /usr/src/coredns/coredns /usr/bin/coredns | ||
COPY rootfs / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
image: ghcr.io/home-assistant/{arch}-hassio-dns | ||
build_from: | ||
aarch64: ghcr.io/home-assistant/aarch64-base:3.17 | ||
armhf: ghcr.io/home-assistant/armhf-base:3.17 | ||
armv7: ghcr.io/home-assistant/armv7-base:3.17 | ||
amd64: ghcr.io/home-assistant/amd64-base:3.17 | ||
i386: ghcr.io/home-assistant/i386-base:3.17 | ||
aarch64: ghcr.io/home-assistant/aarch64-base:3.19 | ||
armhf: ghcr.io/home-assistant/armhf-base:3.19 | ||
armv7: ghcr.io/home-assistant/armv7-base:3.19 | ||
amd64: ghcr.io/home-assistant/amd64-base:3.19 | ||
i386: ghcr.io/home-assistant/i386-base:3.19 | ||
codenotary: | ||
signer: [email protected] | ||
base_image: [email protected] | ||
|
@@ -21,4 +21,4 @@ labels: | |
org.opencontainers.image.documentation: https://www.home-assistant.io/docs/ | ||
org.opencontainers.image.licenses: Apache License 2.0 | ||
args: | ||
COREDNS_VERSION: 1.8.4 | ||
COREDNS_VERSION: 1.8.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters