FROM golang:1.17
LABEL maintainer="[email protected]"
ENV GOPROXY https://goproxy.cn //配置golang 代理
# 安装必要的软件包和依赖包
# USER root
# RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
# sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
# sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
# apt-get update && \
# apt-get upgrade -y && \
# apt-get install -y --no-install-recommends \
# curl \
# zip \
# unzip \
# git \
# vim
# 安装 goctl
# USER root
# RUN GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli
# 安装 protoc
# USER root
# RUN curl -L -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip && \
# unzip -d /tmp/protoc /tmp/protoc.zip && \
# mv /tmp/protoc/bin/protoc $GOPATH/bin
# 安装 protoc-gen-go
# USER root
# RUN go get -u github.com/golang/protobuf/[email protected]
# $GOPATH/bin添加到环境变量中
ENV PATH $GOPATH/bin:$PATH
# 清理垃圾
USER root
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm /var/log/lastlog /var/log/faillog
version: "3"
services:
go:
image: chenchongbiao/go
build:
context: ./
working_dir: /usr/src/code
container_name: go
tty: true
restart: always
volumes:
- ./code:/usr/src/code
command:
- /bin/bash
networks:
- net
networks:
net:
external: true
Content type
Image
Digest
Size
330.1 MB
Last updated
over 4 years ago
docker pull chenchongbiao/go