-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use multistage build, pass macos dwarf flag for local dev
- Loading branch information
Mitch Kelley
committed
May 5, 2019
1 parent
c21c917
commit 5c8ab06
Showing
3 changed files
with
13 additions
and
4 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,2 @@ | ||
|
||
*.out |
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,9 +1,12 @@ | ||
FROM golang:1.12 | ||
|
||
FROM golang:1.12 as builder | ||
WORKDIR /go/src/app | ||
COPY . /go/src/app | ||
|
||
RUN go get -d -v ./... | ||
RUN go install -v ./... | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "-N -l" -ldflags="-compressdwarf=false" -o catalog-go . | ||
|
||
CMD ["app"] | ||
FROM alpine:3.9 | ||
COPY --from=builder /go/src/app /app | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
CMD ["/app/catalog-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
.PHONY: compile-local | ||
compile-local: | ||
CGO_ENABLED=0 go build -gcflags "-N -l" -ldflags="-compressdwarf=false" -o catalog-go.out . |