Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from awiens/master
Adding Docker container and updating README
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Docker version must be 17.05 or higher to allow multistage build | ||
# See build and run instructions in README.md | ||
|
||
# Builds Gas for utilization | ||
FROM golang:1.8.1-alpine as builder | ||
ENV workspace /go/src/github.com/GoASTScanner/gas | ||
ENV GOPATH /go | ||
COPY . $workspace | ||
WORKDIR $workspace | ||
|
||
RUN go vet $(go list ./... | grep -v /vendor/) | ||
RUN CGO_ENABLED=0 go build -o gas . | ||
|
||
######################################################## | ||
|
||
# Runs Gas on all Go files in the current directory when | ||
# 'docker run' command in README is given | ||
FROM alpine:3.6 | ||
|
||
COPY --from=builder /go/src/github.com/GoASTScanner/gas/gas / | ||
|
||
# Mounted directory should be placed into the workdir | ||
CMD /gas $(find . -path ./vendor -prune -o -type f -name "*.go") |
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