Skip to content

Dockerfile.alpine: add Git & Mercurial #922

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

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM golang:1.13-alpine
# required to support cgo
RUN apk --no-cache add gcc musl-dev

# needed most times for `go get`, etc. See https://github.com/docker-library/golang/issues/80
RUN apk add --no-cache git mercurial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove gcc and musl-dev?

Copy link
Contributor Author

@Dominik-K Dominik-K Jan 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jirfag The golang:alpine images already have them installed. See e.g. https://github.com/docker-library/golang/blob/7b69aab8c4a9117743168ca8b19b314c0307e415/1.13/alpine3.11/Dockerfile#L16-L17
(noted it also in the commit message, though)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc and musl-dev are only used for building Go, and they are removed from the golang:alpine image at https://github.com/docker-library/golang/blob/7b69aab8c4a9117743168ca8b19b314c0307e415/1.13/alpine3.11/Dockerfile#L55

Actually, running gcc fails with the golang:alpine image.

$ docker run golang:1.13-alpine gcc
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"gcc\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled
$ docker run golang:1.13-alpine bash
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shogo82148 Thanks for the clarification.
@jirfag I've undone this commit. Sorry about my mistake.


# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY golangci-lint /usr/bin/
CMD ["golangci-lint"]