apt-get update -y
apt-get install -y wget
wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
apt-get install -y vim
apt-get install -y git
apt-get install -y curl
export GOPATH=/root/go
mkdir -p $GOPATH/src/golang.org/x/
cd $GOPATH/src/golang.org/x/
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/text.git
git clone https://github.com/golang/crypto.git
git clone https://github.com/golang/net.git
mkdir -p $GOPATH/src/github.com/gin-gonic/
cd $GOPATH/src/github.com/gin-gonic/
git clone https://github.com/gin-gonic/gin.git
go get -u github.com/gin-gonic/gin
Dockerfile
FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install -y wget
RUN wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin
RUN apt-get install -y vim