[TOC] ## 概述 ``` sudo docker search golang docker pull golang ``` ## run demo ~/go/src/demo/test.go ``` package main import ( "fmt" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("asdadsd")) }) e := http.ListenAndServe(":1234", nil) if e != nil { panic(e) } } ``` 执行 ` docker run -it -v $PWD:/usr/src/go -w /usr/src/go -p 1234:1234 golang go run server.go`