Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
tristiisch committed Sep 30, 2024
1 parent 131fe7b commit 01dd5f7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ jobs:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
echo "platform_pair=${platform//\//-}" >> $GITHUB_OUTPUT
id: prepare

- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -207,7 +208,7 @@ jobs:
PROJECT_VERSION=${{ needs.info.outputs.project_version }}
outputs: |
type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
type=tar,dest=./pyramid.tar
type=docker
- name: Export image digest
run: |
Expand All @@ -218,15 +219,19 @@ jobs:
- name: Upload image digest as artifact
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
name: digests-${{ steps.prepare.outputs.platform_pair }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

- name: Export image
run: |
docker save pyramid:${{ steps.prepare.outputs.platform_pair }} -o "./pyramid.tar"
- name: Upload image as artifact
uses: actions/upload-artifact@v4
with:
name: image-${{ env.PLATFORM_PAIR }}
name: image-${{ steps.prepare.outputs.platform_pair }}
path: ./pyramid.tar
if-no-files-found: error
retention-days: 1
Expand Down
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,27 @@ FROM python:$PYTHON_VERSION-alpine AS builder

WORKDIR /building

RUN \
# Install virtual environment
python -m venv /opt/venv && \
# Upgrade pip to the latest version
pip install --no-cache-dir --upgrade pip
# Install virtual environment
RUN python -m venv /opt/venv

# Add the virtual environment to the PATH
ENV PATH="/opt/venv/bin:$PATH"

# Install dependencies necessary for building Python packages
# Only for ARM64 architecture
RUN if [ "$(uname -m)" = "aarch64" ]; then \
apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev; \
fi

# Copy dependencies list
COPY ./requirements.txt requirements.txt

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

RUN \
# Install dependencies necessary for building Python packages
# Only for ARM64 architecture
if [ "$(uname -m)" = "aarch64" ]; then \
apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev; \
fi && \
# Install Python dependencies
pip install --no-cache-dir -r requirements.txt && \
# Clean up build dependencies for ARM64 architecture
if [ "$(uname -m)" = "aarch64" ]; then \
apk del .build-deps; \
# Clean up build dependencies for ARM64 architecture
RUN if [ "$(uname -m)" = "aarch64" ]; then \
apk del .build-deps; \
fi

# ============================ Base Image ============================
Expand Down

0 comments on commit 01dd5f7

Please sign in to comment.