fix dockerfile for arm64

This commit is contained in:
Jun Kurihara 2023-07-25 00:11:44 +09:00
commit deb7eb1202
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
5 changed files with 19 additions and 74 deletions

View file

@ -6,7 +6,7 @@ SHELL ["/bin/sh", "-x", "-c"]
ENV SERIAL 2
########################################
FROM base as builder
FROM --platform=$BUILDPLATFORM base AS builder
ENV CFLAGS=-Ofast
ENV BUILD_DEPS curl make ca-certificates build-essential
@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -qy --no-install-recommends $BUILD_DEPS &&
strip --strip-all /tmp/target/release/rpxy
########################################
FROM base AS runner
FROM --platform=$TARGETPLATFORM base AS runner
ENV RUNTIME_DEPS logrotate ca-certificates gosu

View file

@ -1,5 +1,5 @@
########################################
FROM messense/rust-musl-cross:x86_64-musl as builder
FROM --platform=$BUILDPLATFORM messense/rust-musl-cross:x86_64-musl AS builder
ENV TARGET_DIR=x86_64-unknown-linux-musl
ENV CFLAGS=-Ofast
@ -15,7 +15,7 @@ RUN echo "Building rpxy from source" && \
musl-strip --strip-all /tmp/target/${TARGET_DIR}/release/rpxy
########################################
FROM alpine:latest as runner
FROM --platform=$TARGETPLATFORM alpine:latest AS runner
LABEL maintainer="Jun Kurihara"
ENV TARGET_DIR=x86_64-unknown-linux-musl

View file

@ -1,5 +1,5 @@
########################################
FROM messense/rust-musl-cross:aarch64-musl as builder
FROM --platform=$BUILDPLATFORM messense/rust-musl-cross:aarch64-musl AS builder
ENV TARGET_DIR=aarch64-unknown-linux-musl
ENV CFLAGS=-Ofast
@ -15,7 +15,7 @@ RUN echo "Building rpxy from source" && \
musl-strip --strip-all /tmp/target/${TARGET_DIR}/release/rpxy
########################################
FROM alpine:latest as runner
FROM --platform=$TARGETPLATFORM alpine:latest AS runner
LABEL maintainer="Jun Kurihara"
ENV TARGET_DIR=aarch64-unknown-linux-musl