nackademin-helloworld
A simple hello world application for Nackademin's course DE22
Requirements
Test application
go test ./...
Build application
<os>
should contain the target OS, examples: linux
, darwin
and windows
.
<arch>
should contain the target architecture, examples: amd64
and arm64
.
CGO_ENABLED=0 GOOS=<os> GOARCH=<arch> go build -o endpoint -o build/endpoint main.go
Build Dockerfile
<version>
should contain a version number, example: 1.0.0
.
docker build -t endpoint:<version> .
Run application
Run application with Go
Run the application without compiling it with Go:
go run main.go
Run application from binary
Run the application from the binary file (assuming it is built):
cd build
./endpoint
# Or
./build/endpoint
Run application with Docker
<version>
should contain a version number, example: 1.0.0
. The same as used when building the Dockerfile.
docker run -d -p 8080:8080 --name endpoint endpoint:<version>