Skip to content

Commit

Permalink
opt out for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 committed Sep 13, 2024
1 parent 931b6cf commit 9e6d416
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0 AS xx
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS build-env
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# export TARGETPLATFORM TARGETOS and TARGETARCH
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH

# install dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential clang curl git ca-certificates
Expand All @@ -38,19 +43,23 @@ ENV PATH="/root/.cargo/bin:${PATH}"
RUN curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash
RUN "${HOME}/.g/bin/g" install 1.21 && ln -sf "${HOME}/.g/go/bin/go" /usr/local/bin/go && go version

# Opt out F3 sidecar FFI build for arm64 for now
RUN if [ "${TARGETARCH}" != "amd64" ] ;then echo FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1 >>/etc/environment ; fi
RUN cat /etc/environment && echo "FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=${FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT}"

# Copy the cross-compilation scripts
COPY --from=xx / /

# export TARGETPLATFORM
ARG TARGETPLATFORM

# Install those packages for the target architecture
RUN xx-apt-get update && \
xx-apt-get install -y libc6-dev g++

WORKDIR /forest
COPY . .

ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}

# Install Forest. Move it out of the cache for the prod image.
RUN --mount=type=cache,sharing=private,target=/root/.cargo/registry \
--mount=type=cache,sharing=private,target=/root/.rustup \
Expand Down

0 comments on commit 9e6d416

Please sign in to comment.