Skip to content
Snippets Groups Projects
Unverified Commit 5a877e21 authored by Will McCutchen's avatar Will McCutchen Committed by GitHub
Browse files

Merge pull request #29 from mccutchen/test-binary

Include test binary in docker image
parents 68e0f465 83b4a61d
Branches
Tags
No related merge requests found
......@@ -6,9 +6,9 @@ COPY Makefile .
RUN make deps
COPY . .
RUN make
RUN make build buildtests
FROM gcr.io/distroless/base
COPY --from=0 /go/src/github.com/mccutchen/go-httpbin/dist/go-httpbin /bin/go-httpbin
COPY --from=0 /go/src/github.com/mccutchen/go-httpbin/dist/go-httpbin* /bin/
EXPOSE 8080
CMD ["/bin/go-httpbin"]
......@@ -33,10 +33,13 @@ build: $(DIST_PATH)/go-httpbin
$(DIST_PATH)/go-httpbin: assets $(GO_SOURCES)
mkdir -p $(DIST_PATH)
go build -o $(DIST_PATH)/go-httpbin ./cmd/go-httpbin
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(DIST_PATH)/go-httpbin ./cmd/go-httpbin
assets: $(GENERATED_ASSETS_PATH)
buildtests:
CGO_ENABLED=0 go test -ldflags="-s -w" -v -c -o $(DIST_PATH)/go-httpbin.test ./httpbin
clean:
rm -rf $(DIST_PATH) $(COVERAGE_PATH)
......@@ -88,7 +91,7 @@ run: build
# =============================================================================
# docker images
# =============================================================================
image: build
image:
docker build -t mccutchen/go-httpbin:$(VERSION) .
imagepush: image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment