-
Notifications
You must be signed in to change notification settings - Fork 527
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
use golang:alpine for golang docker image #194
Conversation
@brettcannon can you have a look please, this addresses issue #176 |
@vladbarosan I'm definitely not qualified to review this since I don't code in Go. 😁 |
configureWorkspace/configure.ts
Outdated
FROM golang:alpine | ||
WORKDIR /go/src/app | ||
COPY . . | ||
RUN apk update && apk upgrade && apk add --no-cache bash git openssh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all would agree with including SSH, see e.g. link. my vote would be to leave it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason to include ssh in a generic builder.
thanks @vladbarosan! would it be better to provide a multi-stage build? see e.g. link. Buffalo creates a multistage build too, see https://github.com/gobuffalo/buffalo/blob/master/generators/docker/multi/templates/Dockerfile.tmpl |
Go containers are often serving TLS services, it would make sense to add |
@joshgav pushed an update using multi-stage build. @bketelsen I added |
Lgtm |
@brettcannon can we merge this please ? thanks |
@vladbarosan I'm still the wrong person to ask this as I've never written a Dockerfile and I still don't code in Go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo my one comment.
@chrisdias can you review and merge? thanks!
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
COPY --from=builder /go/bin/app /app | ||
ENTRYPOINT ./app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be /app
?
LGTM |
Address #176
golang:alpine
sincegolang:onbuild
is deprecated and discouraged from being used.ca-certificates
to enable SSL certificate check