-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
40 lines (26 loc) · 899 Bytes
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM golang:alpine AS builder
WORKDIR /app
RUN apk add git curl
RUN git clone https://github.com/XIU2/CloudflareSpeedTest.git; \
cd CloudflareSpeedTest; \
go build
FROM alpine:latest
LABEL maintainer="Jetsung Chan<[email protected]>"
WORKDIR /app
RUN apk add --no-cache curl bash jq cronie
COPY --from=builder /app/CloudflareSpeedTest/CloudflareSpeedTest /usr/local/bin/CloudflareSpeedTest
COPY --from=builder /app/CloudflareSpeedTest/ip.txt /app/ip.txt
COPY scripts/cfspeedtest.sh /usr/local/bin/cfspeedtest
COPY scripts/cfdns.sh /usr/local/bin/cfdns
RUN chmod +x /usr/local/bin/cfspeedtest
RUN chmod +x /usr/local/bin/cfdns
RUN mkdir ~/.cache
RUN printf "%b" '#!'"/usr/bin/env bash\n \
if [ \"\$1\" = \"daemon\" ]; then \n \
exec crond -n -s -m off \n \
else \n \
exec -- \"\$@\"\n \
fi\n" >/entry.sh && chmod +x /entry.sh
VOLUME /app
ENTRYPOINT ["/entry.sh"]
CMD ["--help"]