mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
Update docker-build steps in Makefile.release (#1200)
* Update docker-build steps in Makefile.release for different architectures Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update to use `case ... esac` in shell script Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Remove `RUN` cmd in Dockerfile in case of non amd64 CPU ssl will only be supported on amd64 CPUs for now. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -100,9 +100,35 @@ upload:
|
|||||||
|
|
||||||
.PHONY: docker-build
|
.PHONY: docker-build
|
||||||
docker-build: tar
|
docker-build: tar
|
||||||
|
# Steps:
|
||||||
|
# 1. Copy appropriate coredns binary to build/docker/linux/<arch>
|
||||||
|
# 2. Copy Dockerfile to build/docker/linux/<arch>
|
||||||
|
# 3. Replace base image from alpine:latest to <arch>/alpine:latest
|
||||||
|
# 4. Comment RUN in Dockerfile
|
||||||
|
# <arch>:
|
||||||
|
# arm: arm32v6
|
||||||
|
# arm64: arm64v8
|
||||||
|
rm -rf build/docker
|
||||||
for arch in $(LINUX_ARCH); do \
|
for arch in $(LINUX_ARCH); do \
|
||||||
tar -xzf release/$(NAME)_$(VERSION)_linux_$$arch.tgz ;\
|
mkdir -p build/docker/linux/$$arch ;\
|
||||||
docker build -t coredns . ;\
|
tar -xzf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/docker/linux/$$arch ;\
|
||||||
|
cp Dockerfile build/docker/linux/$$arch ;\
|
||||||
|
if [ $$arch != amd64 ]; then \
|
||||||
|
case $$arch in \
|
||||||
|
arm) \
|
||||||
|
BASEIMAGE=arm32v6 ;\
|
||||||
|
;; \
|
||||||
|
arm64) \
|
||||||
|
BASEIMAGE=arm64v8 ;\
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
BASEIMAGE=$$arch ;\
|
||||||
|
;; \
|
||||||
|
esac ;\
|
||||||
|
sed -e "s/alpine:latest/$$BASEIMAGE\\/alpine:latest/" -i build/docker/linux/$$arch/Dockerfile ;\
|
||||||
|
sed -e "s/^\\s*RUN/#RUN/" -i build/docker/linux/$$arch/Dockerfile ;\
|
||||||
|
fi ;\
|
||||||
|
docker build -t coredns build/docker/linux/$$arch ;\
|
||||||
docker tag coredns $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
|
docker tag coredns $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user