Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot match release with uname -m with Arm based Docker image #49

Open
back-2-95 opened this issue Aug 18, 2023 · 1 comment
Open

Cannot match release with uname -m with Arm based Docker image #49

back-2-95 opened this issue Aug 18, 2023 · 1 comment

Comments

@back-2-95
Copy link

Expected Behavior

Matching Envplate release with uname -m does not work in Dockerfile for M1 (arm), please see:

curl -LJ --silent https://github.com/kreuzwerker/envplate/releases/download/v1.0.3/envplate_1.0.3_Linux_$(uname -m).tar.gz -o envplate_aarch64.tar.gz

I use this to go around:

#
# Envplate
#
FROM alpine AS envplate-builder

ARG REPO=https://github.com/kreuzwerker/envplate/releases/download
ARG VERSION=1.0.3

WORKDIR /tmp
RUN apk add curl

RUN <<EOF
curl -LJ --silent ${REPO}/v${VERSION}/envplate_${VERSION}_Linux_arm64.tar.gz -o envplate_aarch64.tar.gz
curl -LJ --silent ${REPO}/v${VERSION}/envplate_${VERSION}_Linux_x86_64.tar.gz -o envplate_x86_64.tar.gz
tar -xf envplate_$(uname -m).tar.gz
chmod +x envplate
EOF

Actual Behavior

  • uname -m will give aarch64 instead and thus cannot match to arm64 in release filename.

Steps to Reproduce (including precondition)

Try building Docker image with this Dockerfile in M1/M2 Mac (Silicon/ARM processor):

FROM alpine

RUN apk add curl
RUN curl -LJ --silent https://github.com/kreuzwerker/envplate/releases/download/v1.0.3/envplate_1.0.3_Linux_$(uname -m).tar.gz

Your Environment

  • OS: Alpine 3.18
  • envplate version: 1.0.2, 1.0.3
@back-2-95
Copy link
Author

My current workaround:

FROM alpine AS envplate-builder

ARG VERSION=1.0.3
ARG TARGETPLATFORM

RUN case ${TARGETPLATFORM} in "linux/amd64") ARCH=x86_64 ;; "linux/arm64") ARCH=arm64 ;; esac && echo "$ARCH" && \
    wget -q https://github.com/kreuzwerker/envplate/releases/download/v${VERSION}/envplate_${VERSION}_Linux_${ARCH}.tar.gz -O /envplate && \
    chmod +x /envplate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant