Skip to content

Commit

Permalink
build: correct the ARCH configuration
Browse files Browse the repository at this point in the history
    - we should respect the current platform

Signed-off-by: Vicente Cheng <[email protected]>
(cherry picked from commit 9d756f5)
  • Loading branch information
Vicente-Cheng committed May 21, 2024
1 parent 11bd8ed commit 41cefa1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ RUN cat /tmp/os-release >> /usr/lib/os-release && rm -f /tmp/os-release
# Remove /etc/cos/config to use default values
RUN rm -f /etc/cos/config

ARG TARGETPLATFORM

RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \
exit 1; \
fi

ENV ARCH=${TARGETPLATFORM#linux/}

# Download rancherd
ARG RANCHERD_VERSION=v0.2.0-rc1
RUN curl -o /usr/bin/rancherd -sfL "https://github.com/rancher/rancherd/releases/download/${RANCHERD_VERSION}/rancherd-amd64" && chmod 0755 /usr/bin/rancherd
Expand Down

0 comments on commit 41cefa1

Please sign in to comment.