Skip to content

Commit

Permalink
build arm image
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Jul 24, 2024
1 parent 347bff7 commit e8e879b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/publish_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,28 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: planetariumhq/world-boss-service:git-${{ github.sha }}
- name: setup-qemu
run: |
docker run --rm --privileged multiarch/qemu-user-static \
--reset \
-p yes
- name: build-and-push-amd64
run: |
docker build . \
-f Dockerfile.amd64 \
-t planetariumhq/world-boss-service:git-${{ github.sha }}-amd64 \
--build-arg COMMIT=git-${{ github.sha }}
docker push planetariumhq/world-boss-service:git-${{ github.sha }}-amd64
- name: build-and-push-arm64v8
run: |
docker build . \
-f Dockerfile.arm64v8 \
-t planetariumhq/world-boss-service:git-${{ github.sha }}-arm64v8 \
--build-arg COMMIT=git-${{ github.sha }}
docker push planetariumhq/world-boss-service:git-${{ github.sha }}-arm64v8
- name: merge-manifest-and-push
run: |
docker manifest create planetariumhq/world-boss-service:git-${{ github.sha }} \
--amend planetariumhq/world-boss-service:git-${{ github.sha }}-amd64 \
--amend planetariumhq/world-boss-service:git-${{ github.sha }}-arm64v8
docker manifest push planetariumhq/world-boss-service:git-${{ github.sha }}
18 changes: 18 additions & 0 deletions Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.10.8-bullseye

ARG POETRY_VERSION=1.2.2

RUN apt-get update
RUN apt-get install -y postgresql-client vim jq

# Set up poetry
RUN pip install -U pip "poetry==${POETRY_VERSION}"
RUN poetry config virtualenvs.create false

COPY ./world_boss /app/world_boss
COPY pyproject.toml /app
COPY poetry.lock /app
COPY alembic.ini /app

WORKDIR /app
RUN poetry install --no-root --no-dev
18 changes: 18 additions & 0 deletions Dockerfile.arm64v8
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.10.14-slim-bullseye⁠

ARG POETRY_VERSION=1.2.2

RUN apt-get update
RUN apt-get install -y postgresql-client vim jq

# Set up poetry
RUN pip install -U pip "poetry==${POETRY_VERSION}"
RUN poetry config virtualenvs.create false

COPY ./world_boss /app/world_boss
COPY pyproject.toml /app
COPY poetry.lock /app
COPY alembic.ini /app

WORKDIR /app
RUN poetry install --no-root --no-dev

0 comments on commit e8e879b

Please sign in to comment.