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]>
  • Loading branch information
Vicente-Cheng committed May 20, 2024
1 parent 2a86044 commit a0c7804
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM registry.opensuse.org/isv/rancher/harvester/os/dev/main/baseos:latest AS ba

ARG CACHEBUST

ARG ARCH=amd64
# elemental init first
RUN elemental init --force

Expand All @@ -28,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-${ARCH}" && chmod 0755 /usr/bin/rancherd
Expand Down

0 comments on commit a0c7804

Please sign in to comment.