Public Repository

Last pushed: 9 months ago
Short Description
A simple static linked web server
Full Description

Tags

  • latest tag, Dockerfile. Built on top of alpine image with curl installed.
  • simple tag, contains only a single layer of hello binary. build file
  • alpine tag, Dockerfile. Built on top of alpine image without anything else.

Usage

Listen on 80 by default

docker run -d -p 80:80 chenchun/hello /hello "this is hello server"
docker run -d -P --expose 80 chenchun/hello /hello

Listen on a custom port

docker run -d -e PORT=8080 -p 8080:8080 chenchun/hello /hello

Random message

docker run -d -e RANDOM=1 chenchun/hello /hello

# exec into container
curl http://localhost
server 604: Hello World from Go in minimal Docker container
# the number "604" in the curl response is generated randomly on init

Program code

https://github.com/chenchun/dockerfile/blob/master/hello/hello.go

Docker Pull Command
Owner
chenchun

Comments (0)