mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Added hello image.
This commit is contained in:
10
images/hello/Dockerfile
Normal file
10
images/hello/Dockerfile
Normal 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
17
images/hello/hello.go
Normal 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
5
images/hello/release.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
set -e
|
||||
|
||||
docker build -t funcy/hello:latest .
|
||||
|
||||
docker push funcy/hello:latest
|
||||
Reference in New Issue
Block a user