forked from ps2zhuantou/mosdns-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubuntu
45 lines (35 loc) · 1.25 KB
/
Dockerfile.ubuntu
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
41
42
43
44
FROM --platform=${TARGETPLATFORM} golang:bullseye as builder
ARG CGO_ENABLED=0
ARG TAG
ARG REPOSITORY
WORKDIR /root
SHELL ["/bin/bash", "-c"]
RUN apt-get install -y git \
&& git clone https://github.com/${REPOSITORY} mosdns \
&& cd ./mosdns \
&& git fetch --all --tags \
&& git checkout tags/${TAG} \
&& go build -ldflags "-s -w -X main.version=${TAG}" -trimpath -o mosdns
# FROM --platform=${TARGETPLATFORM} fedora:latest
# FROM --platform=${TARGETPLATFORM} ubuntu:22.04
FROM --platform=${TARGETPLATFORM} ubuntu:latest
LABEL maintainer="fordes123 <github.com/fordes123>"
ENV TZ=Asia/Shanghai \
CRON="0 0 */7 * *"
# USER root
USER 0
WORKDIR /etc/mosdns
COPY --from=builder /root/mosdns/mosdns /usr/bin/
COPY scripts /scripts
COPY config/* /etc/mosdns/
SHELL ["/bin/bash", "-c"]
# RUN apt-get update && apt-get install -y ca-certificates wget cronie tzdata
# RUN sudo bash -c " apt-get install -y ca-certificates wget cron tzdata \
# RUN echo "apt-get install " && apt-get install -y ca-certificates wget cron tzdata
RUN apt-get install -y ca-certificates wget cron tzdata
# && sudo chmod a+x /scripts/* \
# && sudo sed '1s/sh/bash/g' /scripts/*.sh \
# && sudo /scripts/update.sh
VOLUME /etc/mosdn
EXPOSE 53/udp 53/tcp
ENTRYPOINT [ "/scripts/entrypoint.sh" ]