Skip to content
Snippets Groups Projects
Commit 8b1273c4 authored by Will McCutchen's avatar Will McCutchen
Browse files

Add Dockerfile and image build process

parent 251b5f5b
No related branches found
No related tags found
No related merge requests found
FROM gcr.io/distroless/base
COPY go-httpbin /bin/go-httpbin
EXPOSE 8080
CMD ["/bin/go-httpbin"]
......@@ -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
......@@ -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/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment