added buildx-qemu image
parent
fc02adc694
commit
b857c82f2a
5
Makefile
5
Makefile
|
@ -1,7 +1,7 @@
|
|||
REGISTRY=registry.monotremata.xyz
|
||||
PLATFORMS=linux/amd64,linux/arm64
|
||||
|
||||
IMAGES=agate mpd pleroma rainloop tor transmission webdav
|
||||
IMAGES=agate buildx-qemu mpd pleroma rainloop tor transmission webdav
|
||||
|
||||
.PHONY: all $(IMAGES)
|
||||
|
||||
|
@ -12,6 +12,9 @@ BUILDX=docker buildx build --platform $(PLATFORMS) --tag $(REGISTRY)/$@ --push $
|
|||
agate:
|
||||
$(BUILDX)
|
||||
|
||||
buildx-qemu:
|
||||
$(BUILDX)
|
||||
|
||||
mpd:
|
||||
$(BUILDX)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ docker registry.
|
|||
## Currently implemented images:
|
||||
|
||||
* agate
|
||||
* buildx-qemu (image I use to build the other images in my CI/CD)
|
||||
* mpd
|
||||
* pleroma
|
||||
* rainloop
|
||||
|
@ -23,6 +24,12 @@ docker registry.
|
|||
* transmission
|
||||
* webdav (really simple nginx + `nginx-mod-http-dav-ext` image)
|
||||
|
||||
## Create buildx driver
|
||||
|
||||
```sh
|
||||
docker buildx create --use
|
||||
```
|
||||
|
||||
## Enable multi-arch execution
|
||||
|
||||
```sh
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
FROM debian:bullseye-slim
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
ENV DOCKER_URL=https://download.docker.com/linux/debian
|
||||
ENV GPG_FILE=/etc/apt/keyrings/docker.gpg
|
||||
ENV DEBIAN_VERSION=bullseye
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
mkdir -p /etc/apt/keyrings && \
|
||||
curl -fsSL "$DOCKER_URL/gpg" | gpg --dearmor -o "$GPG_FILE" && \
|
||||
echo "deb [arch=$TARGETARCH signed-by=$GPG_FILE] $DOCKER_URL $DEBIAN_VERSION stable" > \
|
||||
/etc/apt/sources.list.d/docker.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
binfmt-support \
|
||||
docker-ce-cli \
|
||||
make \
|
||||
qemu-user-static && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
@ -0,0 +1,29 @@
|
|||
IMG_NAME=buildx-qemu
|
||||
REGISTRY=registry.monotremata.xyz
|
||||
IMG=$(REGISTRY)/$(IMG_NAME)
|
||||
PLATFORMS=linux/amd64,linux/arm64
|
||||
|
||||
.PHONY: build push buildx
|
||||
|
||||
ARCH=$(shell uname -m)
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
TARGETARCH=amd64
|
||||
else ifeq ($(ARCH),aarch64)
|
||||
TARGETARCH=arm64
|
||||
else
|
||||
TARGETARCH=amd64
|
||||
endif
|
||||
|
||||
build: Dockerfile entrypoint.sh
|
||||
docker build -t $(IMG) --build-arg TARGETARCH=$(TARGETARCH) .
|
||||
|
||||
push: build
|
||||
docker image push $(IMG)
|
||||
|
||||
buildx: Dockerfile entrypoint.sh
|
||||
docker buildx build \
|
||||
--platform $(PLATFORMS) \
|
||||
--tag $(IMG) \
|
||||
--push \
|
||||
.
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
update-binfmts --enable
|
||||
docker buildx create --use
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
exec "$@"
|
Loading…
Reference in New Issue