Build multi-arch images by default

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-05-30 23:25:56 -04:00
parent 0f20548386
commit d250b97b43
18 changed files with 226 additions and 206 deletions

View file

@ -17,17 +17,25 @@
# 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 = httpbin
IMAGE = $(REGISTRY)/$(IMGNAME)
IMAGE = $(REGISTRY)/httpbin
container:
$(DOCKER) buildx build \
.PHONY: image
image:
docker buildx build \
--load \
--platform linux/amd64 \
--platform $(ARCH) \
-t $(IMAGE):$(TAG) rootfs
clean:
$(DOCKER) rmi -f $(IMAGE):$(TAG) || true

View file

@ -12,18 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.11
FROM alpine:3.12
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN echo "@edge http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
&& apk update \
&& apk add --no-cache \
python3 python3-dev \
musl-dev gcc g++ make \
libffi libffi-dev libstdc++ \
py3-gevent py3-gunicorn py3-wheel@edge \
RUN apk update \
&& apk add --no-cache \
python3 python3-dev \
musl-dev gcc g++ make \
libffi libffi-dev libstdc++ \
py3-gevent py3-gunicorn py3-wheel \
py3-pip \
&& pip3 install httpbin \
&& apk del python3-dev musl-dev gcc g++ make libffi-dev