Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Last active March 21, 2016 18:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngauthier/887b059b967b044a3772 to your computer and use it in GitHub Desktop.
Save ngauthier/887b059b967b044a3772 to your computer and use it in GitHub Desktop.
GDG Docker App Example

GDG Docker Code Lab Example App

Build it:

$ docker build -t greeter .

Run it:

$ docker run -it greeter
Enter your name: Nick
Hello Nick!
FROM golang
ADD main.go ./
RUN go build -o greeter main.go
CMD ["./greeter"]
package main
import (
"fmt"
"os"
)
func main() {
var name string
fmt.Printf("Enter your name: ")
fmt.Fscanln(os.Stdin, &name)
fmt.Printf("Hello %s!\n", name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment