forked from securego/gosec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore the temporary image file used for builds Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * no need for GOPATH in the Dockerfile It is already set in the golang:1.10.3-alpine3.8 image. Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * no need for GOROOT in Dockerfile The correct value is embedded in the go tool. Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * bump Dockerfile golang to 1.10.4 The latest golang version thus far. Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * replace docker-entrypoint.sh with the gosec binary Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * git ignore gosec binary Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * refactor Dockerfile into multi-stage First stage does the build in a pristine alpine environment. Second stage is a minimal image with just the necessary stuff to run the compiled binary. Also added packages for gcc and musl-dev so cgo can do its thang. Signed-off-by: Andrew Hsu <andrewhsu@docker.com> * fix the image execution example in README.md Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
- Loading branch information
Showing
5 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
FROM golang:1.10.3-alpine3.8 | ||
FROM golang:1.10.4-alpine3.8 as build | ||
WORKDIR /go/src/github.com/securego/gosec | ||
COPY . . | ||
RUN apk add -U git make | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
RUN make | ||
|
||
ENV BIN=gosec | ||
ENV GOROOT=/usr/local/go | ||
ENV GOPATH=/go | ||
|
||
COPY $BIN /go/bin/$BIN | ||
COPY docker-entrypoint.sh /usr/local/bin | ||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
FROM golang:1.10.4-alpine3.8 | ||
RUN apk add -U gcc musl-dev | ||
COPY --from=build /go/src/github.com/securego/gosec/gosec /usr/local/bin/gosec | ||
ENTRYPOINT ["gosec"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.