Skip to content

Commit

Permalink
Merge pull request #17 from runwaylab/multi-arch
Browse files Browse the repository at this point in the history
Multi-Arch Support
  • Loading branch information
GrantBirki authored May 8, 2024
2 parents bee6b33 + eb79be4 commit 3debce2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64

# - name: generate artifact attestation
# uses: actions/[email protected]
Expand Down
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.12.1 as builder
FROM 84codes/crystal:1.12.1-ubuntu-24.04 AS builder

LABEL org.opencontainers.image.title="runway"
LABEL org.opencontainers.image.description="clearing code for take off"
Expand Down Expand Up @@ -34,21 +34,17 @@ COPY . .
# build the project
RUN script/build

FROM crystallang/crystal:1.12.1
FROM 84codes/crystal:1.12.1-ubuntu-24.04

# install runtime dependencies
RUN apt-get update && apt-get install libssh2-1-dev -y

# create a non-root user for security
RUN useradd -m nonroot
USER nonroot

WORKDIR /app

######### CUSTOM SECTION PER PROJECT #########

# copy the binary from the builder stage
COPY --from=builder --chown=nonroot:nonroot /app/bin/runway .
COPY --from=builder /app/bin/runway .

# run the binary
ENTRYPOINT ["./runway"]
15 changes: 4 additions & 11 deletions acceptance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.12.1 as builder
FROM 84codes/crystal:1.12.1-ubuntu-24.04 AS builder

WORKDIR /app

Expand Down Expand Up @@ -30,25 +30,18 @@ COPY . .
# build the project
RUN script/build

FROM crystallang/crystal:1.12.1
FROM 84codes/crystal:1.12.1-ubuntu-24.04

# install runtime dependencies
RUN apt-get update && apt-get install libssh2-1-dev -y

# add curl for healthchecks
# RUN apt-get update && apt-get install -y curl

# create a non-root user for security
RUN useradd -m nonroot
USER nonroot

WORKDIR /app

######### CUSTOM SECTION PER PROJECT #########

# copy the binary from the builder stage
COPY --from=builder --chown=nonroot:nonroot /app/acceptance/ssh_server/keys/ /app/acceptance/ssh_server/keys/
COPY --from=builder --chown=nonroot:nonroot /app/bin/runway .
COPY --from=builder /app/acceptance/ssh_server/keys/ /app/acceptance/ssh_server/keys/
COPY --from=builder /app/bin/runway .

# run the binary
ENTRYPOINT ["./runway"]
2 changes: 1 addition & 1 deletion script/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [ -f "$DIR/bin/ameba" ]; then
fi
fi

if [ "$AMEBA_UP_TO_DATE" = false ]; then
if [ "$AMEBA_UP_TO_DATE" = false ] && [ "$USE_LINUX_VENDOR" != true ]; then
echo "building ameba binary"
cd "$DIR/lib/ameba" && shards build && cp bin/ameba "$DIR/bin/ameba" && cd "$DIR"
fi

0 comments on commit 3debce2

Please sign in to comment.