update
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@ -0,0 +1,35 @@
|
||||
FROM reg.charlienet.top/go/golang:1.22-alpine as builder
|
||||
|
||||
ARG app_name=echo
|
||||
RUN echo $app_name
|
||||
|
||||
ENV APPNAME=echo
|
||||
RUN echo $app_name
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN echo $app_name
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV GOPROXY https://goproxy.cn,direct
|
||||
RUN go mod tidy && go build -ldflags="-s -w"
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
# 使用阿里云镜像
|
||||
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
# RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /build/echo echo
|
||||
|
||||
# COPY conf conf
|
||||
|
||||
# ENV GIN_MODE=release
|
||||
# ENV PATH /app:$PATH
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./echo"]
|
Reference in New Issue
Block a user