A very simple stateless HTTP API written in Go
export VERSION=1.18.3
curl -O https://dl.google.com/go/go$VERSION.linux-amd64.tar.gz
sha256sum go$VERSION.linux-amd64.tar.gz
tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
- To persist this across bash sessions, add to
~/.bashrc
go version
go build cmd/hello/hello.go
./hello
curl localhost:8180
curl localhost:8180/test
curl localhost:8180/anyurihere/1/2/3/4
nerdctl build -t <image-name> .
- e.g. -
nerdctl build -t tonydawson1000/ocp-go-api .
nerdctl images
nerdctl run --name hello-go --rm -p 8180:8180 <image-name>
- e.g. -
nerdctl run --name hello-go --rm -p 8180:8180 tonydawson1000/ocp-go-api
curl localhost:8180
curl localhost:8180/test
curl localhost:8180/anyurihere/1/2/3/4
- Login (Default Docker Hub)
nerdctl login
- Push
nerdctl push <image-name>:<tag>
- e.g. -
nerdctl push tonydawson1000/ocp-go-api:latest