-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad7500c
commit c18d7a9
Showing
4 changed files
with
49 additions
and
3 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
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,34 @@ | ||
FROM golang:1.14-alpine AS build | ||
|
||
# Install git + SSL ca certificates. | ||
# Git is required for fetching the dependencies. | ||
# Ca-certificates is required to call HTTPS endpoints. | ||
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates | ||
|
||
# Copy project files | ||
WORKDIR /go/src | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN mkdir /dir | ||
|
||
# Fetch dependencies | ||
RUN go mod download | ||
COPY . . | ||
|
||
# Fetch dependencies (go mod) | ||
RUN go mod download | ||
RUN go mod verify | ||
|
||
# Build project | ||
ENV CGO_ENABLED=0 | ||
RUN go build -o go-rest-assured ./cmd/go-assured | ||
|
||
FROM scratch AS runtime | ||
|
||
# Copy dependent files | ||
COPY --from=build /go/src/go-rest-assured ./ | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
EXPOSE 8080/tcp | ||
|
||
ENTRYPOINT ["./go-rest-assured"] |
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