Skip to content

Commit

Permalink
Merge pull request #9 from karuboniru/multiarch_docker
Browse files Browse the repository at this point in the history
Also build docker image for arm64
  • Loading branch information
URenko authored Jan 18, 2024
2 parents 64ecad5 + 19ef3ec commit f82bec4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
with:
cosign-release: 'v2.1.1'

# Set up QEMU for cross-platform builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
Expand Down Expand Up @@ -106,6 +110,7 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.meta_dockerhub.outputs.tags }}
Expand All @@ -121,6 +126,7 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.meta-full.outputs.tags }}
${{ steps.meta_dockerhub-full.outputs.tags }}
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ ARG BUILDTYPE=minimal
FROM debian:12-slim AS build-venv

RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends --yes xz-utils python3 python3-venv && \
apt-get install --no-install-suggests --no-install-recommends --yes gcc python3-dev python3 python3-venv && \
apt-get clean && \
python3 -m venv /venv && \
/venv/bin/pip install --upgrade pip

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

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

FROM product-env-${BUILDTYPE}
COPY --from=build-venv /venv /venv
COPY --from=build-venv /usr/bin/7zz /usr/bin
COPY --from=build-venv /usr/bin/ffmpeg /usr/bin
COPY --from=build-venv /userdata /userdata
COPY --from=quay.io/karuboniru/7zz:2301 \
/usr/local/bin/7zz /usr/bin
COPY --from=docker.io/mwader/static-ffmpeg:latest \
/ffmpeg /usr/bin

ENV content=/root/comiclib watch=False
EXPOSE 8000
WORKDIR /userdata
Expand Down

0 comments on commit f82bec4

Please sign in to comment.