Added hello image.

This commit is contained in:
Travis Reeder
2017-05-30 09:52:44 -07:00
parent 2518898b65
commit 7b408468fa
3 changed files with 32 additions and 0 deletions

10
images/hello/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
# build stage
FROM golang:alpine AS build-env
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM funcy/base
WORKDIR /app
COPY --from=build-env /src/goapp /app/
ENTRYPOINT ./goapp

17
images/hello/hello.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"encoding/json"
"fmt"
"os"
)
type Person struct {
Name string
}
func main() {
p := &Person{Name: "World"}
json.NewDecoder(os.Stdin).Decode(p)
fmt.Printf("Hello %v!\n", p.Name)
}

5
images/hello/release.sh Normal file
View File

@@ -0,0 +1,5 @@
set -e
docker build -t funcy/hello:latest .
docker push funcy/hello:latest