Yq: 3.2.3 is dynamically linked

Created on 9 Sep 2020  ·  6Comments  ·  Source: mikefarah/yq

Describe the bug

Release 3.2.3 is dynamically linked and does not work in Alpine docker images.

Steps to reproduce

Prepare 2 Dockerfiles:

Dockerfile.323:

FROM alpine:3.12.0

RUN apk add --update --no-cache curl file &&\
    wget https://github.com/mikefarah/yq/releases/download/3.2.3/yq_linux_amd64 -O /usr/bin/yq &&\
    chmod +x /usr/bin/yq

and Dockerfile.332:

FROM alpine:3.12.0

RUN apk add --update --no-cache curl file &&\
    wget https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_amd64 -O /usr/bin/yq &&\
    chmod +x /usr/bin/yq

run:

docker build -t yq323 -f Dockerfile.323 .
docker build -t yq332 -f Dockerfile.332 .

then run:

docker run --rm -it yq332 /bin/sh                  
/ # which yq
/usr/bin/yq
/ # file /usr/bin/yq
/usr/bin/yq: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=yFKSa2WYcfADm3PzesX2/S8743m7kpOnwE5aM6qBP/p0pr1qgLgutlk31synf0/6ieaYLztxUsvh42I4070, not stripped
/ # yq -h
yq is a lightweight and portable command-line YAML processor. It aims to be the jq or sed of yaml files.

Usage:
  yq [flags]
  yq [command]
[....]

and to compare:

docker run --rm -it yq323 /bin/sh
/ # which yq
/usr/bin/yq
/ # file /usr/bin/yq
/usr/bin/yq: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=w1lOXagZ5d5A2eQpRSJ3/QaVmjVK5FM7KiNrIuj0l/nYcfIs8k9V98bXXV5HzJ/wMz8PQj-ptZggOdrWqaI, not stripped
/ # yq -h
/bin/sh: yq: not found

Expected behavior
both versions work

bug

Most helpful comment

Also note that the release seems to be mislabeled.. it should be 3.3.3 not 3.2.3.

All 6 comments

Also note that the release seems to be mislabeled.. it should be 3.3.3 not 3.2.3.

facepalm re verison. I'll have to fix that up.

Not sure about the dynamic linking :/ I used the same build process

got hit by this in our CI. since we install yq every time which is not right. and when we try to use yq we get no such file 🤕
```
wget $(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4) -O /usr/bin/yq

_facepalm_ re verison. I'll have to fix that up.

Not sure about the dynamic linking :/ I used the same build process

@mikefarah I noticed you upgraded GO to 1.15 and I found this issue related to something similar. Look also into issues mentioned in conversation there. BTW, I love yq! 👍

got hit by this in our CI. since we install yq every time which is not right. and when we try to use yq we get no such file 🤕

wget $(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4) -O /usr/bin/yq

@mshivanna Exactly same situation here. We were about to bump version of yq anyways so it just made things happen sooner ;)

Ok Latest release fixes the version inconsistency, and the dynamic linking. Sorry bout that folks

Thanks! And thanks for making yq - it's a great tool!

On Thu, Sep 10, 2020 at 6:23 PM Mike Farah notifications@github.com wrote:

Ok Latest release fixes the version inconsistency, and the dynamic
linking. Sorry bout that folks


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mikefarah/yq/issues/532#issuecomment-690817235, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AE5BP7KMBLA26SCUFBZSAJTSFF3YRANCNFSM4RCGGLPA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdaguerre picture cdaguerre  ·  4Comments

pcrocker-pivotal picture pcrocker-pivotal  ·  3Comments

jmreicha picture jmreicha  ·  9Comments

tamalsaha picture tamalsaha  ·  5Comments

jmreicha picture jmreicha  ·  5Comments