pms/cicd/Dockerfile

13 lines
381 B
Docker
Raw Normal View History

2024-08-17 16:52:03 +08:00
ARG registry=registry.cn-hangzhou.aliyuncs.com/syschan
FROM ${registry}/golang:alpine as builder
WORKDIR /app
2024-08-17 18:46:50 +08:00
COPY . .
2024-08-17 17:32:34 +08:00
RUN go generate
2024-08-17 17:43:56 +08:00
RUN go build -o ./pms-server -v .
2024-08-17 16:52:03 +08:00
FROM ${registry}/alpine:latest
WORKDIR /app
2024-08-17 17:43:56 +08:00
COPY --from=builder /app/pms-server .
2024-08-17 17:32:34 +08:00
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add bash
CMD ["bash","-c","pms-server"]