1.Dockerfile
FROM alpine:3.16.2 COPY go1.17.linux-amd64.tar.gz /go/go1.17.linux-amd64.tar.gz RUN tar -zxvf /go/go1.17.linux-amd64.tar.gz ENV GOPATH=/go ENV PATH=$PATH:$GOPATH/bin
2.打包镜像
docker build -t alpine:3.16.2-go1.17 .
3.进入容器,验证环境
docker run -it alpine:3.16.2-go1.17 bash
go version
标签:tar,go1.17,gz,3.16,构建,linux,go,镜像 From: https://www.cnblogs.com/wdgde/p/16615231.html