Skip to content

Commit

Permalink
try to fix building on arm64 for katbin
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwen committed Aug 23, 2024
1 parent 266364e commit 561e65a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/caddy-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
id: caddy_version
run: |
CADDY_VERSION=$(docker run --rm caddy:2-alpine caddy version | cut -d ' ' -f 1)
echo "version=${CADDY_VERSION}" >> $GITHUB_OUTPUT
echo "CADDY_VERSION=${CADDY_VERSION}" >> $GITHUB_ENV
echo "version=${CADDY_VERSION#v}" >> $GITHUB_OUTPUT
echo "CADDY_VERSION=${CADDY_VERSION#v}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -53,4 +53,4 @@ jobs:
tags: |
ghcr.io/${{ github.repository_owner }}/caddy:latest
ghcr.io/${{ github.repository_owner }}/caddy:2
ghcr.io/${{ github.repository_owner }}/caddy:2.${{ env.CADDY_VERSION }}
ghcr.io/${{ github.repository_owner }}/caddy:${{ env.CADDY_VERSION }}
8 changes: 4 additions & 4 deletions katbin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elixir:1.14-alpine AS build
FROM --platform=$BUILDPLATFORM elixir:1.14-alpine AS build

# install build dependencies
RUN apk add --no-cache build-base npm git curl py-pip rust cargo
Expand All @@ -18,7 +18,8 @@ COPY source/mix.exs source/mix.lock ./
COPY source/config config

# Update hex and rebar, then get and compile dependencies
RUN mix local.hex --force && \
RUN apk add --no-cache openssl ca-certificates && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get && \
mix deps.compile
Expand All @@ -34,8 +35,7 @@ COPY source/native native
RUN npm run --prefix ./assets deploy
RUN mix phx.digest

# uncomment COPY if rel/ exists
# COPY rel rel
# Build release
RUN mix do compile, release

# prepare release image
Expand Down

0 comments on commit 561e65a

Please sign in to comment.