Build multi-arch images by default
This commit is contained in:
parent
0f20548386
commit
d250b97b43
18 changed files with 226 additions and 206 deletions
|
|
@ -1,6 +1,14 @@
|
|||
FROM openresty/openresty:1.15.8.2-alpine
|
||||
FROM quay.io/kubernetes-ingress-controller/nginx:e3c49c52f4b74fe47ad65d6f3266a02e8b6b622f
|
||||
|
||||
RUN apk add -U perl curl \
|
||||
&& opm get bungle/lua-resty-template
|
||||
RUN apk add -U perl curl make unzip
|
||||
|
||||
COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
|
||||
RUN wget -O /tmp/luarocks.tgz https://github.com/luarocks/luarocks/archive/v3.3.1.tar.gz \
|
||||
&& tar -C /tmp -xzf /tmp/luarocks.tgz \
|
||||
&& cd /tmp/luarocks* \
|
||||
&& ./configure \
|
||||
&& make install \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
RUN luarocks install lua-resty-template
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
|
|
|||
|
|
@ -17,17 +17,27 @@
|
|||
# Use the 0.0 tag for testing, it shouldn't clobber any release builds
|
||||
TAG ?= 0.0
|
||||
|
||||
HOSTARCH := $(shell uname -m | sed -e s/x86_64/amd64/ \
|
||||
-e s/s390x/s390x/ \
|
||||
-e s/armv7l/arm/ \
|
||||
-e s/aarch64.*/arm64/)
|
||||
|
||||
ifndef ARCH
|
||||
ARCH := $(HOSTARCH)
|
||||
endif
|
||||
ifeq ($(ARCH),)
|
||||
$(error mandatory variable ARCH is empty)
|
||||
endif
|
||||
|
||||
REGISTRY ?= ingress-controller
|
||||
DOCKER ?= docker
|
||||
|
||||
IMGNAME = echo
|
||||
IMAGE = $(REGISTRY)/$(IMGNAME)
|
||||
IMAGE = $(REGISTRY)/echo
|
||||
|
||||
container:
|
||||
$(DOCKER) buildx build \
|
||||
image:
|
||||
docker buildx build \
|
||||
--load \
|
||||
--platform linux/amd64 \
|
||||
--platform $(ARCH) \
|
||||
-t $(IMAGE):$(TAG) .
|
||||
|
||||
clean:
|
||||
$(DOCKER) rmi -f $(IMAGE):$(TAG) || true
|
||||
docker rmi -f $(IMAGE):$(TAG) || true
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ env POD_NAME;
|
|||
env POD_NAMESPACE;
|
||||
env POD_IP;
|
||||
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue