Go build helper script (#163)

Create a docker container and a script to call it, to help people build go plugins for use with fission.
This commit is contained in:
Soam Vasani
2017-03-27 23:26:59 -07:00
committed by GitHub
parent a13015e75a
commit a6eb4c6d31
5 changed files with 30 additions and 15 deletions
+6 -1
View File
@@ -2,7 +2,7 @@
This is the Go environment for Fission.
It's a Docker image containing a Go 1.8rc3 runtime, along with a dynamic loader.
It's a Docker image containing a Go 1.8 runtime, along with a dynamic loader.
## Build this image
@@ -27,3 +27,8 @@ fission env update --name go-runtime --image USER/go-runtime
After this, fission functions that have the env parameter set to the
same environment name as this command will use this environment.
## Creating functions to use this image
See the [examples README](examples/go/README.md).
+5
View File
@@ -0,0 +1,5 @@
FROM golang:1.8
ENV GOPATH /usr
RUN go get github.com/fission/fission
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
if [ $# -eq 0 ]
then
echo "No arguments, building current dir"
filename='.'
else
filename=$1
fi
docker run --rm -v $(pwd):/build -w /build fission/go-builder go build -buildmode=plugin -o function.so $filename && echo "Compiled plugin: function.so. Use 'fission function create' to upload to fission."