-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
47 lines (35 loc) · 1.32 KB
/
Dockerfile.template
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
FROM resin/%%RESIN_MACHINE_NAME%%-python as builder
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -yq \
build-essential pkg-config libdbus-1-dev libdbus-glib-1-dev && \
rm -rf /var/lib/apt/lists/*
# Install python modules
RUN pip install wheel
RUN pip install requests
RUN pip install python-networkmanager
# Base build completed
# Deploying final App
FROM resin/%%RESIN_MACHINE_NAME%%-python:slim
RUN apt-get update && apt-get install -yq --no-install-recommends \
net-tools curl modemmanager logrotate squid3 iptables watchdog && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Copy files from builder container
COPY --from=builder /usr/local/lib/python2.7/site-packages/ /usr/local/lib/python2.7/site-packages/
COPY src/entry.sh /usr/bin/entry.sh
COPY src/start.sh /usr/src/app
COPY src/reconnect.sh /usr/src/app
COPY src/bashrc /root/.bashrc
COPY src/soracom.py /usr/src/app
COPY src/wifishare.py /usr/src/app
COPY src/ethshare.py /usr/src/app
COPY src/logrotate.conf /usr/src/app
COPY src/squid3.conf /etc/squid3/squid.conf
RUN chmod 777 /usr/src/app/start.sh
RUN chmod 777 /usr/src/app/reconnect.sh
RUN chmod 777 /usr/bin/entry.sh
RUN systemctl disable ModemManager
RUN systemctl mask ModemManager
RUN systemctl disable udevd
ENV INITSYSTEM off
CMD ["bash", "/usr/src/app/start.sh"]