Custom language pack for Go

Change-Id: Ia2de63e72b03d48e6dc541bc982b728684531bb6
This commit is contained in:
Devdatta Kulkarni 2014-07-16 09:48:28 -05:00
parent 23beaa91d8
commit a8a7c355f5
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Language pack with Go runtime
FROM ubuntu:trusty
MAINTAINER Devdatta Kulkarni <devdatta.kulkarni@rackspace.com>
RUN apt-get -yqq update && apt-get -yqq install curl build-essential libxml2-dev libxslt-dev git autoconf wget golang
ADD hello.go /tmp/hello.go
ADD testgo.sh /tmp/testgo.sh
RUN cd /tmp && bash testgo.sh

View File

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Printf("hello world\n")
}

View File

@ -0,0 +1,13 @@
#!/bin/bash -x
# This script tests whether golang tools were correctly installed or not
return_value=`go run ./hello.go`
if [ "$return_value" == "hello world" ]; then
echo "Go tools correctly installed."
exit 0
else
echo "Go tools not correctly installed."
echo "Expected:hello world; Got: $return_value"
exit 1
fi