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

cgo runtime error with golang:1.11beta2-alpine3.7 #230

Closed
mfridman opened this issue Jul 31, 2018 · 1 comment
Closed

cgo runtime error with golang:1.11beta2-alpine3.7 #230

mfridman opened this issue Jul 31, 2018 · 1 comment
Labels
question Usability question, not directly related to an error with the image

Comments

@mfridman
Copy link

mfridman commented Jul 31, 2018

Trying to run a few tests inside this container and seeing cgo errors:

GOGC=off go test -run ...

# runtime/cgo
exec: "gcc": executable file not found in $PATH

Is this by design, where the consumer of the image must apk add gcc and fix any dependency issues, apk add musl-dev ?

EDIT: the docker image already has those items

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
bash \
gcc \
musl-dev \
openssl \
go \
; \

Noticed a similar issue here, golang/go/issues/26307

@tianon
Copy link
Member

tianon commented Jul 31, 2018

If you look a little further down, the Alpine image removes those again:

apk del .build-deps; \

See also https://hub.docker.com/_/golang/, under "golang:alpine":

To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the alpine image description for examples of how to install packages if you are unfamiliar).

And #119.

@wglambert wglambert added question Usability question, not directly related to an error with the image and removed Issue labels Jul 31, 2018
@yosifkit yosifkit closed this as completed Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

4 participants