1ARG GOVERSION=1.14
2FROM golang:${GOVERSION}
3
4# Set base env.
5ARG GOOS=linux
6ARG GOARCH=amd64
7ENV GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'
8
9# Pre compile the stdlib for 386/arm (32bits).
10RUN go build -a std
11
12# Add the code to the image.
13WORKDIR pty
14ADD . .
15
16# Build the lib.
17RUN go build
18