12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- # FROM golang:1.21.3-alpine3.18 as builder
- # ENV GOPROXY https://goproxy.cn/
- # WORKDIR /go/release
- # COPY go.mod ./go.mod
- # RUN go mod tidy
- # COPY . .
- # RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o observe .
- FROM alpine:3.18
- RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
- RUN apk add --no-cache tzdata
- ENV TZ=Asia/Shanghai
- # COPY --from=builder /go/release/observe /app/observe
- # COPY --from=builder /go/release/config/settings.yml /app/settings.yml
- # COPY --from=builder /go/release/version /app/version
- COPY bin/observe /app/observe
- COPY ./config/settings.yml /app/settings.yml
- COPY ./version /app/version
- EXPOSE 8000
- RUN chmod +x /app/observe
- CMD ["/app/observe","server","-c", "/app/settings.yml"]
- # FROM golang:1.19.3
- # ENV GOPROXY https://goproxy.cn/
- # RUN apt install apt-transport-https ca-certificates
- # RUN apt-get update && apt-get install -yq tzdata vim iputils-ping net-tools telnet iotop
- # ENV TZ="Asia/Shanghai"
- # RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
- # RUN dpkg-reconfigure -f noninteractive tzdata
- # RUN mkdir -p /app
- # COPY bin/observe /app/observe
- # COPY ./config /app/config
- # COPY ./version /app/version
- # EXPOSE 8000
- # RUN chmod +x /app/observe
- # CMD ["/app/observe","server","-c", "/app/settings.yml"]
|