-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
# Use build argument to determine architecture
ARG TARGETARCH
# Base stage to select appropriate Alpine image
FROM alpine:3.20 AS base
# Set environment variable to identify architecture
ENV ARCH=$TARGETARCH
# Conditional logic for ARM architecture
FROM base AS arm64
RUN if [ "$ARCH" = "arm64" ]; then \
echo "Detected ARM architecture, using ARM-specific Alpine image"; \
apk add --no-cache bash; \
else \
echo "Non-ARM architecture detected, using standard Alpine image"; \
apk add --no-cache bash; \
fi
# Final stage
FROM arm64
# Example: Add a simple command to verify the setup
CMD ["echo", "Running on $ARCH architecture with Alpine"]
Metadata
Metadata
Assignees
Labels
No labels