加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 761 Bytes
一键复制 编辑 原始数据 按行查看 历史
FROM golang:alpine as builder
ARG APP=ginadmin
ARG VERSION=v10.0.2
ARG RELEASE_TAG=$(VERSION)
# Install the required packages
RUN apk add --no-cache gcc musl-dev sqlite-dev
# Set CGO_CFLAGS to enable large file support
ENV CGO_CFLAGS "-D_LARGEFILE64_SOURCE"
# ENV GOPROXY="https://goproxy.cn"
WORKDIR /go/src/${APP}
COPY . .
# Build the application
RUN go build -ldflags "-w -s -X main.VERSION=${RELEASE_TAG}" -o ./${APP} .
FROM alpine
ARG APP=ginadmin
WORKDIR /go/src/${APP}
COPY --from=builder /go/src/${APP}/${APP} /usr/bin/
# COPY --from=builder /go/src/${APP}/configs /usr/bin/configs
# COPY --from=builder /go/src/${APP}/dist /usr/bin/dist
ENTRYPOINT ["ginadmin", "start", "-d", "/usr/bin/configs", "-c", "prod", "-s", "/usr/bin/dist"]
EXPOSE 8040
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化