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
No related branches found
No related tags found
No related merge requests found
...@@ -6,9 +6,9 @@ COPY Makefile . ...@@ -6,9 +6,9 @@ COPY Makefile .
RUN make deps RUN make deps
COPY . . COPY . .
RUN make RUN make build buildtests
FROM gcr.io/distroless/base 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 EXPOSE 8080
CMD ["/bin/go-httpbin"] CMD ["/bin/go-httpbin"]
...@@ -33,10 +33,13 @@ build: $(DIST_PATH)/go-httpbin ...@@ -33,10 +33,13 @@ build: $(DIST_PATH)/go-httpbin
$(DIST_PATH)/go-httpbin: assets $(GO_SOURCES) $(DIST_PATH)/go-httpbin: assets $(GO_SOURCES)
mkdir -p $(DIST_PATH) 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) assets: $(GENERATED_ASSETS_PATH)
buildtests:
CGO_ENABLED=0 go test -ldflags="-s -w" -v -c -o $(DIST_PATH)/go-httpbin.test ./httpbin
clean: clean:
rm -rf $(DIST_PATH) $(COVERAGE_PATH) rm -rf $(DIST_PATH) $(COVERAGE_PATH)
...@@ -88,7 +91,7 @@ run: build ...@@ -88,7 +91,7 @@ run: build
# ============================================================================= # =============================================================================
# docker images # docker images
# ============================================================================= # =============================================================================
image: build image:
docker build -t mccutchen/go-httpbin:$(VERSION) . docker build -t mccutchen/go-httpbin:$(VERSION) .
imagepush: image imagepush: image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment