Skip to content

Commit

Permalink
Restore multi-platform alpine image
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed Jun 1, 2024
1 parent 3363892 commit 6eec7e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 129 deletions.
16 changes: 16 additions & 0 deletions .docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ RUN apk add --no-cache \
python3-dev \
py3-pip

# On arm64, we need to build cffi from source.
ARG TARGETPLATFORM

RUN if [ "${TARGETPLATFORM}" == "linux/arm64" ]; then \
apk add --no-cache \
build-base \
autoconf \
automake \
libtool \
zlib-dev \
libffi-dev \
cairo-dev \
pkgconfig \
; \
fi

COPY . /app

WORKDIR /app
Expand Down
79 changes: 0 additions & 79 deletions .docker/Dockerfile.alpine-arm64

This file was deleted.

53 changes: 3 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ jobs:
--tag "${DOCKER_REPOSITORY}/${DOCKER_IMAGE_NAME}-ubuntu:${DOCKER_IMAGE_TAG}" \
--file .docker/Dockerfile .
docker_alpine_x64:
name: Build Alpine-based Docker images x64
docker_alpine:
name: Build Alpine-based Docker images
needs: [wheel_sdist_linux, test_linux, test_macos, test_windows]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -369,53 +369,6 @@ jobs:
run: |
docker buildx build \
--push \
--platform linux/amd64 \
--platform linux/amd64,linux/arm64 \
--tag "${DOCKER_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" \
--file .docker/Dockerfile.alpine .
docker_alpine_arm64:
name: Build Alpine-based Docker images arm64
needs: [wheel_sdist_linux, test_linux, test_macos, test_windows]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Set image tag to release or branch
run: echo "DOCKER_IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: If main, set to latest
run: echo 'DOCKER_IMAGE_TAG=latest' >> $GITHUB_ENV
if: env.DOCKER_IMAGE_TAG == 'main'

- name: Set Docker Hub repository to username
run: echo "DOCKER_REPOSITORY=jbarlow83" >> $GITHUB_ENV

- name: Set image name
run: echo "DOCKER_IMAGE_NAME=ocrmypdf-alpine" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: jbarlow83
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Print image tag
run: echo "Building image ${DOCKER_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}"

- name: Build
run: |
docker buildx build \
--push \
--platform linux/arm64 \
--tag "${DOCKER_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" \
--file .docker/Dockerfile.alpine-arm64 .

0 comments on commit 6eec7e2

Please sign in to comment.