diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7fee17d8e83a11d8284a84829bdaf30f5f7c8eb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM gcr.io/distroless/base +COPY go-httpbin /bin/go-httpbin +EXPOSE 8080 +CMD ["/bin/go-httpbin"] diff --git a/Makefile b/Makefile index 43e8449851b85c53adbee6bdcc7d125a736349d9..f6fa9d45c53a1336d3592bda71be04b7a0fcb9ce 100644 --- a/Makefile +++ b/Makefile @@ -24,4 +24,11 @@ clean: deps: go get -u github.com/jteeuwen/go-bindata/... -.PHONY: all +image: assets cmd/go-httpbin/*.go httpbin/*.go + mkdir -p /tmp/go-httpbin-docker + cp Dockerfile /tmp/go-httpbin-docker + GOOS=linux GOARCH=amd64 go build -o /tmp/go-httpbin-docker/go-httpbin ./cmd/go-httpbin + docker build -t mccutchen/go-httpbin /tmp/go-httpbin-docker + +imagepush: image + docker push mccutchen/go-httpbin diff --git a/README.md b/README.md index 5a2fb19140f0ae7a4b02c936ec9468414eab9ccb..23c90ac9263ac96d8c5093114199ec2704f9ae72 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ Usage of ./dist/go-httpbin: Port to listen on (default 8080) ``` +Docker images are also available on [Docker Hub][docker-hub]: + +``` +$ docker run -P mccutchen/go-httpbin +``` + ## Installation ``` @@ -38,13 +44,19 @@ go get github.com/mccutchen/go-httpbin/... ## Development ``` +# local development make make test make testcover make run + +# building & pushing docker images +make image +make imagepush ``` [kr]: https://github.com/kennethreitz [httpbin-org]: https://httpbin.org/ [httpbin-repo]: https://github.com/kennethreitz/httpbin [ahmet-go-httpbin]: https://github.com/ahmetb/go-httpbin +[docker-hub]: https://hub.docker.com/r/mccutchen/go-httpbin/