Skip to content

Commit

Permalink
fix: alpine build
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Aug 26, 2022
1 parent 2b64f4b commit b3d15f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
strategy:
fail-fast: false
matrix:
container-image-arch: [ amd64, arm64, arm ]
container-image-arch: [ amd64, arm64 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -234,17 +234,11 @@ jobs:
with:
name: arm64
path: .
- name: Download arm Container Image
uses: actions/download-artifact@v3
with:
name: arm
path: .

- name: Restore container images
run: |
podman load --input amd64.tar
podman load --input arm64.tar
podman load --input arm.tar
- name: Create container image manifest
run: buildah manifest create multiarch-manifest
Expand All @@ -253,7 +247,6 @@ jobs:
run: |
buildah manifest add multiarch-manifest ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}_amd64
buildah manifest add multiarch-manifest ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}_arm64
buildah manifest add multiarch-manifest ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}_arm
- name: Login to docker hub
run: podman login docker.io --username ${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
10 changes: 3 additions & 7 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# # # # # # # # # # # # # # # # # # # #
# Builder
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
FROM alpine:3 as builder
FROM rust:alpine as builder

# Create a cache directory that will be copied into the final image
RUN mkdir "/cache"

# Install ssl certificates that will also be copied into the final image
RUN apk update && apk add --no-cache ca-certificates

# Install Rust toolchain
RUN apk add --no-cache build-base git curl
RUN curl '=https' --tlsv1.2 https://sh.rustup.rs > /rustup.sh && sh /rustup.sh -y
RUN apk update && apk add --no-cache alpine-sdk ca-certificates

# Update crates io index via git cli, otherwise we'll an out of memory when building for arm https://github.com/rust-lang/cargo/issues/9167
RUN mkdir -p ~/.cargo/
Expand All @@ -27,7 +23,7 @@ COPY Cargo.toml Cargo.lock /app/
COPY src/ /app/src

# Build the application
RUN ~/.cargo/bin/cargo build --release
RUN cargo build --release

# # # # # # # # # # # # # # # # # # # #
# Run image
Expand Down

0 comments on commit b3d15f1

Please sign in to comment.