Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also build docker image for arm64 #9

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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