Skip to content

Commit f82bec4

Browse files
authored
Merge pull request #9 from karuboniru/multiarch_docker
Also build docker image for arm64
2 parents 64ecad5 + 19ef3ec commit f82bec4

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/workflows/docker-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
with:
4646
cosign-release: 'v2.1.1'
4747

48+
# Set up QEMU for cross-platform builds
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v3
51+
4852
# Set up BuildKit Docker container builder to be able to build
4953
# multi-platform images and export cache
5054
# https://github.com/docker/setup-buildx-action
@@ -106,6 +110,7 @@ jobs:
106110
with:
107111
context: .
108112
push: ${{ github.event_name != 'pull_request' }}
113+
platforms: linux/amd64,linux/arm64
109114
tags: |
110115
${{ steps.meta.outputs.tags }}
111116
${{ steps.meta_dockerhub.outputs.tags }}
@@ -121,6 +126,7 @@ jobs:
121126
with:
122127
context: .
123128
push: ${{ github.event_name != 'pull_request' }}
129+
platforms: linux/amd64,linux/arm64
124130
tags: |
125131
${{ steps.meta-full.outputs.tags }}
126132
${{ steps.meta_dockerhub-full.outputs.tags }}

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@ ARG BUILDTYPE=minimal
33
FROM debian:12-slim AS build-venv
44

55
RUN apt-get update && \
6-
apt-get install --no-install-suggests --no-install-recommends --yes xz-utils python3 python3-venv && \
6+
apt-get install --no-install-suggests --no-install-recommends --yes gcc python3-dev python3 python3-venv && \
77
apt-get clean && \
88
python3 -m venv /venv && \
99
/venv/bin/pip install --upgrade pip
1010

11-
ADD https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/ffmpeg-linux-x64 /usr/bin/ffmpeg
12-
ADD https://www.7-zip.org/a/7z2301-linux-x64.tar.xz /tmp/
13-
RUN tar -C /usr/bin -xvf /tmp/7z*.tar.xz 7zz
1411
COPY . /tmp/comiclib
1512
RUN /venv/bin/pip install --no-cache-dir -U "/tmp/comiclib[full]"
1613
RUN /venv/bin/pip install --no-cache-dir -U gunicorn
1714
RUN mkdir /userdata
1815

19-
FROM debian:12-slim AS data
16+
FROM quay.io/karuboniru/7zz:2301 AS data
2017
ADD https://files.niconi.org/api_dump.sqlite.7z /tmp
21-
COPY --from=build-venv /usr/bin/7zz /usr/bin
2218
RUN mkdir /exract
2319
WORKDIR /extract
2420
RUN 7zz x /tmp/api_dump.sqlite.7z
@@ -33,9 +29,12 @@ ENV importEHdb_database_URI=file:api_dump.sqlite?mode=rw
3329

3430
FROM product-env-${BUILDTYPE}
3531
COPY --from=build-venv /venv /venv
36-
COPY --from=build-venv /usr/bin/7zz /usr/bin
37-
COPY --from=build-venv /usr/bin/ffmpeg /usr/bin
3832
COPY --from=build-venv /userdata /userdata
33+
COPY --from=quay.io/karuboniru/7zz:2301 \
34+
/usr/local/bin/7zz /usr/bin
35+
COPY --from=docker.io/mwader/static-ffmpeg:latest \
36+
/ffmpeg /usr/bin
37+
3938
ENV content=/root/comiclib watch=False
4039
EXPOSE 8000
4140
WORKDIR /userdata

0 commit comments

Comments
 (0)