added buildx-qemu image
parent
fc02adc694
commit
b857c82f2a
5
Makefile
5
Makefile
|
@ -1,7 +1,7 @@
|
||||||
REGISTRY=registry.monotremata.xyz
|
REGISTRY=registry.monotremata.xyz
|
||||||
PLATFORMS=linux/amd64,linux/arm64
|
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)
|
.PHONY: all $(IMAGES)
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ BUILDX=docker buildx build --platform $(PLATFORMS) --tag $(REGISTRY)/$@ --push $
|
||||||
agate:
|
agate:
|
||||||
$(BUILDX)
|
$(BUILDX)
|
||||||
|
|
||||||
|
buildx-qemu:
|
||||||
|
$(BUILDX)
|
||||||
|
|
||||||
mpd:
|
mpd:
|
||||||
$(BUILDX)
|
$(BUILDX)
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ docker registry.
|
||||||
## Currently implemented images:
|
## Currently implemented images:
|
||||||
|
|
||||||
* agate
|
* agate
|
||||||
|
* buildx-qemu (image I use to build the other images in my CI/CD)
|
||||||
* mpd
|
* mpd
|
||||||
* pleroma
|
* pleroma
|
||||||
* rainloop
|
* rainloop
|
||||||
|
@ -23,6 +24,12 @@ docker registry.
|
||||||
* transmission
|
* transmission
|
||||||
* webdav (really simple nginx + `nginx-mod-http-dav-ext` image)
|
* webdav (really simple nginx + `nginx-mod-http-dav-ext` image)
|
||||||
|
|
||||||
|
## Create buildx driver
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker buildx create --use
|
||||||
|
```
|
||||||
|
|
||||||
## Enable multi-arch execution
|
## Enable multi-arch execution
|
||||||
|
|
||||||
```sh
|
```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