Skip to content

Commit 80dae3a

Browse files
committed
doc: document ghcr as alternative to docker hub
1 parent ae8a6ed commit 80dae3a

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

README.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@ A reasonably complete and well-tested golang port of [Kenneth Reitz][kr]'s
1111

1212
## Usage
1313

14-
### Docker
14+
### Docker/OCI images
1515

16-
Docker images are published to [Docker Hub][docker-hub]:
16+
Prebuilt images for the `linux/amd64` and `linux/arm64` architectures are
17+
automatically published to these public registries for every tagged release:
18+
- GitHub Container Registry: [ghcr.io/mccutchen/go-httpbin][ghcr]
19+
- **Note:** Only version `2.17` and later
20+
- Docker Hub: [mccutchen/go-httpbin][docker-hub]
1721

1822
```bash
1923
# Run http server
20-
$ docker run -P mccutchen/go-httpbin
24+
$ docker run -P ghcr.io/mccutchen/go-httpbin
2125

2226
# Run https server
23-
$ docker run -e HTTPS_CERT_FILE='/tmp/server.crt' -e HTTPS_KEY_FILE='/tmp/server.key' -p 8080:8080 -v /tmp:/tmp mccutchen/go-httpbin
27+
$ docker run -e HTTPS_CERT_FILE='/tmp/server.crt' -e HTTPS_KEY_FILE='/tmp/server.key' -p 8080:8080 -v /tmp:/tmp ghcr.io/mccutchen/go-httpbin
2428
```
2529

2630
### Kubernetes
@@ -34,19 +38,19 @@ See `./kustomize` directory for further information
3438
### Standalone binary
3539

3640
Follow the [Installation](#installation) instructions to install go-httpbin as
37-
a standalone binary. (This currently requires a working Go runtime.)
41+
a standalone binary, or use `go run` to install it on demand:
3842

3943
Examples:
4044

4145
```bash
4246
# Run http server
43-
$ go-httpbin -host 127.0.0.1 -port 8081
47+
$ go run github.com/mccutchen/go-httpbin/v2/cmd/go-httpbin@latest -host 127.0.0.1 -port 8081
4448

4549
# Run https server
4650
$ openssl genrsa -out server.key 2048
4751
$ openssl ecparam -genkey -name secp384r1 -out server.key
4852
$ openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
49-
$ go-httpbin -host 127.0.0.1 -port 8081 -https-cert-file ./server.crt -https-key-file ./server.key
53+
$ go run github.com/mccutchen/go-httpbin/v2/cmd/go-httpbin@latest -host 127.0.0.1 -port 8081 -https-cert-file ./server.crt -https-key-file ./server.key
5054
```
5155

5256
### Unit testing helper library
@@ -114,7 +118,8 @@ variables (or a combination of the two):
114118

115119
## Installation
116120

117-
To add go-httpbin to an existing golang project:
121+
To add go-httpbin as a dependency to an existing golang project (e.g. for use
122+
in unit tests):
118123

119124
```
120125
go get -u github.com/mccutchen/go-httpbin/v2
@@ -123,7 +128,7 @@ go get -u github.com/mccutchen/go-httpbin/v2
123128
To install the `go-httpbin` binary:
124129

125130
```
126-
go install github.com/mccutchen/go-httpbin/v2/cmd/go-httpbin
131+
go install github.com/mccutchen/go-httpbin/v2/cmd/go-httpbin@latest
127132
```
128133

129134

@@ -223,8 +228,11 @@ Compared to [ahmetb/go-httpbin][ahmet]:
223228

224229

225230
[ahmet]: https://github.com/ahmetb/go-httpbin
231+
[alibaba-headers]: https://www.alibabacloud.com/help/en/fc/user-guide/specification-details#section-3f8-5y1-i77
232+
[DEVELOPMENT.md]: ./DEVELOPMENT.md
226233
[docker-hub]: https://hub.docker.com/r/mccutchen/go-httpbin/
227234
[examples/custom-instrumentation]: ./examples/custom-instrumentation/
235+
[ghcr]: https://github.com/mccutchen/go-httpbin/pkgs/container/go-httpbin
228236
[httpbin-org]: https://httpbin.org/
229237
[httpbin-repo]: https://github.com/kennethreitz/httpbin
230238
[httpbingo.org]: https://httpbingo.org/
@@ -233,5 +241,3 @@ Compared to [ahmetb/go-httpbin][ahmet]:
233241
[Observer]: https://pkg.go.dev/github.com/mccutchen/go-httpbin/v2/httpbin#Observer
234242
[Production considerations]: #production-considerations
235243
[zerolog]: https://github.com/rs/zerolog
236-
[DEVELOPMENT.md]: ./DEVELOPMENT.md
237-
[alibaba-headers]: https://www.alibabacloud.com/help/en/fc/user-guide/specification-details#section-3f8-5y1-i77

kustomize/resources.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
spec:
88
containers:
99
- name: httpbin
10-
image: mccutchen/go-httpbin
10+
image: ghcr.io/mccutchen/go-httpbin
1111
ports:
1212
- name: http
1313
containerPort: 8080

0 commit comments

Comments
 (0)