-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.x86_64
106 lines (88 loc) · 2.75 KB
/
Dockerfile.x86_64
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM balenalib/intel-nuc-ubuntu-node:bionic-build
ARG DBUS_SYSTEM_BUS_ADDRESS
ENV DBUS_SYSTEM_BUS_ADDRESS ${DBUS_SYSTEM_BUS_ADDRESS:-unix:path=/host/run/dbus/system_bus_socket}
# Deprecated INITSYSTEM as of balenalib major changes
# https://www.balena.io/docs/reference/base-images/base-images/#major-changes
# ENV INITSYSTEM On
# RUN [ "cross-build-start" ]
ENV DEBIAN_FRONTEND noninteractive
ARG DEBUG
ENV DEBUG ${DEBUG:-0}
ARG BALENA_ARCH
ENV S6_ARCH ${BALENA_ARCH:-x86_64}
ENV PRIV_INT wlan0
ENV PRIV_NETWORK 10.3.0
ENV PRIV_NETWORK_MASK 255.255.255.0
ENV PRIV_NETWORK_MASKb 24
ENV WAN_NETWORK 192.168.1
ENV WAN_NETWORK_MASK 255.255.255.0
ENV WAN_NETWORK_MASKb 24
ENV WAN_INT wlan1
ARG AP_SSID
ENV PRIV_SSID ${AP_SSID:-'MyHotspot'}
ARG AP_PASSWORD
ENV PRIV_PASSWD ${AP_PASSWORD:-'1passWoRd'}
ENV PRIV_WIFI_MODE a
ENV PRIV_WIFI_CTY FR
ENV PRIV_WIFI_CHANNEL 36
ENV DNS1 192.168.1.1
ENV DNS2 8.8.8.8
ARG WIFI_SSID
ENV WAN_SSID ${WIFI_SSID:-'HomeWifi'}
ARG WIFI_PASSWORD
ENV WAN_PASSWD ${WIFI_PASSWORD:-'1passWoRd'}
ENV DNS1_IPV6 2001:4860:4860::8888
ENV DNS2_IPV6 2001:4860:4860::8844
ENV PRIV_RANGE_START 2
ENV PRIV_RANGE_END 253
ENV PRIV_NETWORK_IPV6 2a01:e0a:16b:dc30::
ENV PRIV_NETWORK_MASKb6 64
ENV WAN_NETWORK_IPV6 2a01:db8:0:1::
ENV WAN_NETWORK_MASKb6 64
RUN \
echo "**** install runtime packages ****" && \
install_packages \
network-manager \
hostapd \
haveged \
bridge-utils \
isc-dhcp-server \
iptables \
ufw \
wpasupplicant \
netplan.io \
dnsmasq \
tcpdump \
python3 \
python3-pip \
python3-networkmanager
# ADD S6 Overlay
ARG S6_OVERLAY_VERSION=3.1.2.1
RUN apt-get update && apt-get install -y nginx xz-utils
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
CMD ["/usr/sbin/nginx"]
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz
ENV UDEV on
ADD "https://raw.githubusercontent.com/b23prodtm/docker-systemctl-replacement/master/files/docker/systemctl3.py" /bin/systemctl
RUN chmod g+xs /bin/systemctl
WORKDIR /usr/src/
# Python modules
COPY library/ library/
RUN chmod -R 4755 library
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install -r library/requirements.txt
# Node node_modules
RUN npm update && npm link balena-cloud-apps
# Bash scripts
COPY root/ /
COPY scripts/ scripts/
RUN chmod -R 4755 scripts \
&& cp scripts/init.d/hapwizard /etc/init.d/.
VOLUME /etc/hostapd/
VOLUME /etc/hapwizard/
ENTRYPOINT /usr/bin/entry.sh true
# RUN [ "cross-build-end" ]
CMD tcpdump -v -i ${PRIV_INT} -Z ${USER} 2>/dev/null