golang / dep

Go dependency management tool experiment (deprecated)
https://golang.github.io/dep/
BSD 3-Clause "New" or "Revised" License
12.85k stars 1.05k forks source link

Segmentation fault golang alpine #2192

Closed chrisdlangton closed 5 years ago

chrisdlangton commented 5 years ago

using this simple Dockerfile;

FROM golang:alpine
RUN apk add git && \
    wget -q -O - https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

Assuming docker build -t <tag> . and docker run -it --entrypoint=/bin/sh <tag>

Running dep init produces Segmentation fault. and which dep produces /go/bin/dep as expected.

Is alpine not yet supported?

nathanejohnson commented 5 years ago

alpine uses musl libc versus glibc, so you will need to use the alpine packaged version of dep - the dep binary releases link to glibc. if you include the alpine community repository this should be available, just apk add dep. Alternatively, you can amend the Dockerfile to build dep from source.

nathanejohnson commented 5 years ago

as a followup, this works for me:

FROM golang:alpine
RUN apk add git && apk add dep

406812a41c0e:~# dep version
dep:
 version     : 0.5.0
 build date  : 
 git hash    : 
 go version  : go1.12.5
 go compiler : gc
 platform    : linux/amd64
 features    : ImportDuringSolve=false
406812a41c0e:~# 
chrisdlangton commented 5 years ago

Verified working :+1:

Suggest an alpine support section of the docos to describe this, i went looking and had to report it here, of course only needed if there's no intention to support alpine via install.sh going forward