我想将我的 Go 服务器部署到 Google Cloud Run。我从本指南复制了 Dockerfile 。
FROM golang:1.13 as builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -v -o server
RUN chmod a+x server
FROM alpine:3
RUN apk add --no-cache ca-certificates
COPY --from=builder /app/server /server
CMD ["/server"]
在将其部署到 Cloud Run 之前,我想通过使用 构建映像并docker build -t server .运行容器来在本地测试它docker run server。
它失败并出现以下错误:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"/server\": permission denied": unknown.
感谢您的帮助。
Helenr
饮歌长啸
holdtom
相关分类