Smaller docker image

This commit is contained in:
Ben Wilson 2020-04-07 10:01:23 -04:00
parent 10e06e385c
commit 3e1e2e7202
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,11 @@
FROM golang:1.13 FROM golang:1.13 as builder
ADD . /workspace/cloudlog ADD . /app/
WORKDIR /workspace/cloudlog WORKDIR /app/
RUN make build RUN make build
ENTRYPOINT ["/workspace/cloudlog/cloudlog"]
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/cloudlog /usr/local/bin/
ENTRYPOINT ["cloudlog"]

View File

@ -20,7 +20,7 @@ all: build
# Build binary # Build binary
build: build:
go build $(LDFLAGS) CGO_ENABLED=0 go build $(LDFLAGS)
test: test:
go test -v ./... go test -v ./...