2023-09-04 10:57:40 +07:00
|
|
|
FROM golang:1.21-bookworm AS builder
|
|
|
|
RUN apt-get update && apt-get install -y llvm-15 clang-15 git make
|
|
|
|
ENV CLANG=clang-15
|
2023-03-04 12:16:26 +07:00
|
|
|
WORKDIR /build/
|
|
|
|
ADD go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD . .
|
|
|
|
RUN git submodule update --init
|
|
|
|
RUN make OUTPUT=dae GOFLAGS="-buildvcs=false" CC=clang CGO_ENABLED=0
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
RUN mkdir -p /usr/local/share/dae/
|
|
|
|
RUN mkdir -p /etc/dae/
|
2023-07-01 11:05:03 +07:00
|
|
|
RUN wget -O /usr/local/share/dae/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
|
|
|
|
RUN wget -O /usr/local/share/dae/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
|
2023-03-04 12:16:26 +07:00
|
|
|
COPY --from=builder /build/dae /usr/local/bin
|
|
|
|
COPY --from=builder /build/install/empty.dae /etc/dae/config.dae
|
|
|
|
RUN chmod 0600 /etc/dae/config.dae
|
2023-03-14 16:21:25 +07:00
|
|
|
|
|
|
|
CMD ["dae"]
|
|
|
|
ENTRYPOINT ["dae", "run", "-c", "/etc/dae/config.dae"]
|