-
Notifications
You must be signed in to change notification settings - Fork 6k
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 #10863 from swagger-api/issue-8320
added docker file for go-server generator
- Loading branch information
Showing
2 changed files
with
15 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
14 changes: 14 additions & 0 deletions
14
modules/swagger-codegen/src/main/resources/go-server/Dockerfile
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,14 @@ | ||
FROM golang:1.10 AS build | ||
WORKDIR /go/src | ||
COPY go ./go | ||
COPY main.go . | ||
|
||
ENV CGO_ENABLED=0 | ||
RUN go get -d -v ./... | ||
|
||
RUN go build -a -installsuffix cgo -o swagger . | ||
|
||
FROM scratch AS runtime | ||
COPY --from=build /go/src/swagger ./ | ||
EXPOSE 8080/tcp | ||
ENTRYPOINT ["./swagger"] |