We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FROM golang:1.21.5-alpine
WORKDIR /go/src/go_chat COPY . .
ENV GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY="https://goproxy.cn,direct" RUN echo http://mirrors.aliyun.com/alpine/v3.10/community/ > /etc/apk/repositories && echo http://mirrors.aliyun.com/alpine/v3.10/main/ >> /etc/apk/repositories && apk add tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN go build -o go_chat .
CMD ["./go_chat"]
构造镜像后 运行 docker run -d -v /root/chat/go-chat:/app -p 9503:9503 --name go_chat_http-1 --restart=always go_chat http 无效 末尾的 http是要启动的服务类别
The text was updated successfully, but these errors were encountered:
No branches or pull requests
FROM golang:1.21.5-alpine
WORKDIR /go/src/go_chat
COPY . .
为我们的镜像设置必要的环境变量
ENV GO111MODULE=on
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
GOPROXY="https://goproxy.cn,direct"
RUN echo http://mirrors.aliyun.com/alpine/v3.10/community/ > /etc/apk/repositories
&& echo http://mirrors.aliyun.com/alpine/v3.10/main/ >> /etc/apk/repositories
&& apk add tzdata
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&& echo 'Asia/Shanghai' >/etc/timezone
RUN go build -o go_chat .
CMD ["./go_chat"]
构造镜像后 运行 docker run -d -v /root/chat/go-chat:/app -p 9503:9503 --name go_chat_http-1 --restart=always go_chat http 无效 末尾的 http是要启动的服务类别
The text was updated successfully, but these errors were encountered: