项目作者: T-Hugo

项目描述 :
HTTP server printing the hostname for the load balancer testing, about ~1.67 MB in size!
高级语言: Go
项目地址: git://github.com/T-Hugo/docker-go-hello.git
创建时间: 2020-02-24T02:10:11Z
项目社区:https://github.com/T-Hugo/docker-go-hello

开源协议:MIT License

下载


HTTP server in Go, printing the current hostname for load balancer testing

Docker Cloud Build Status
Go Report Card
Docker Size
GitHub

HTTP server printing the hostname for the load balancer testing, about ~1.67 MB in size!

Program written in Go which spins up a web server and prints its current hostname (i.e. the docker container ID), its IP address and port as well as the request URI and the local time of the web server.

Build via a multi-stage build and compress with UPX to make the image as small as possible ~1.67MB

How to use this image

``` shell script
docker run —rm -it -p 8080:80 hugobin/go-hello

  1. ``` shell script
  2. $ curl http://localhost:8080/somepath?foo=bar
  3. Hello from b2a20cada094
  4. Server address: 172.17.0.2:80
  5. Server name: b2a20cada094
  6. Date: 2020-02-23T23:30:33Z
  7. URI: /somepath?foo=bar

This image was created to be used as a simple backends for various load balancing testing.