forked from lucktu/n2n
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.ubuntu-latest
84 lines (69 loc) · 2.43 KB
/
Dockerfile.ubuntu-latest
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM debian:stable-slim as downloader
ARG name="n2n-downloader"
ARG summary="Base build image for n2n-lucktu built on-top of debian:stable-slim"
LABEL description="${summary}" \
maintainer="<[email protected]>" \
app.kubernetes.io/name="${name}" \
org.opencontainers.image.title="${name}" \
org.opencontainers.artifact.description="${summary}" \
org.opencontainers.image.description="${summary}" \
org.opencontainers.image.documentation="https://github.com/zctmdc/docker/tree/alpha/n2n-lucktu/doc/build.md"\
org.opencontainers.image.licenses="MIT"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update
RUN apt-get -qq -y install \
bash curl wget unzip
# 安装RAR
WORKDIR /tmp/scripts/
COPY ./scripts/init_logger.sh ./scripts/install_rar.sh /tmp/scripts/
RUN chmod +x /tmp/scripts/*.sh
RUN /tmp/scripts/install_rar.sh
ARG KERNEL=linux
# 用于自定义机型编译,未自动识别时请赋值
ARG MACHINE
ARG BIG_VERSION
ARG SMALL_VERSION
ARG COMMIT
ARG VERSION_B_S_rC
ARG MANUAL_BUILD
# 选择对应版本文件
WORKDIR /tmp/n2n-lucktu/scripts/
# COPY . /tmp/n2n-lucktu/
# RUN chmod +x /tmp/n2n-lucktu/scripts/*.sh
# RUN /tmp/n2n-lucktu/scripts/build-docker.sh
# RUN mkdir -p /tmp/down/ && cp /tmp/n2n-lucktu/result/build_src/* /tmp/down/ && ls /tmp/down/
COPY ./result/build_src/ /tmp/down/
COPY ./scripts/ /tmp/n2n-lucktu/scripts/
# 解压,选择最大的edge文件
RUN /tmp/n2n-lucktu/scripts/extract_n2n.sh
RUN /tmp/n2n-lucktu/scripts/sel_n2n.sh
FROM ubuntu:18.04
ARG name="n2n-lucktu"
ARG summary="n2n-lucktu built on-top of ubuntu:18.04"
LABEL description="${summary}" \
maintainer="<[email protected]>" \
app.kubernetes.io/name="${name}" \
org.opencontainers.image.title="${name}" \
org.opencontainers.artifact.description="${summary}" \
org.opencontainers.image.description="${summary}" \
org.opencontainers.image.licenses="MIT"
# edge need ifconfig
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update
RUN apt-get -qq -y install \
net-tools busybox iptables isc-dhcp-client isc-dhcp-server inetutils-ping
RUN touch /var/lib/dhcp/dhcpd.leases
WORKDIR /usr/local/sbin/
COPY --from=downloader \
/tmp/desc/supernode \
/tmp/desc/edge \
/usr/local/sbin/
RUN ls
WORKDIR /tmp/n2n-lucktu/scripts/
COPY ./scripts/*.sh /tmp/n2n-lucktu/scripts/
RUN chmod +x /tmp/n2n-lucktu/scripts/*
RUN /tmp/n2n-lucktu/scripts/fixlib.sh
RUN rm -rf /tmp/*
WORKDIR /usr/local/sbin/
ARG VERSION_B_S_rC
ENV VERSION_B_S_rC=${VERSION_B_S_rC}