update
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
FROM golang:latest as builder
|
||||
FROM golang:alpine as builder
|
||||
# RUN apt install -y git make
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk --no-cache add make git
|
||||
LABEL anther="cjun"
|
||||
WORKDIR /tinyurl
|
||||
COPY . /tinyurl
|
||||
@@ -9,10 +11,12 @@ RUN make build
|
||||
|
||||
FROM alpine:latest AS runner
|
||||
# 设置alpine 时间为上海时间
|
||||
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk --no-cache add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||
&& apk del tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=builder /tinyurl/bin/tinyurl /app/tinyurl
|
||||
COPY --from=builder /tinyurl/dist/ /app/dist/
|
||||
COPY --from=builder /tinyurl/configs/ /app/configs/
|
||||
EXPOSE 2830
|
||||
CMD ["./tinyurl"]
|
||||
Reference in New Issue
Block a user