-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
107 lines (84 loc) · 3.84 KB
/
Dockerfile
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
107
FROM alpine:3.10
MAINTAINER Slavey Karadzhov "slav@attachix.com"
# ------------------------------------------------------------------------------
# Install Cloud9 and Supervisor
# ------------------------------------------------------------------------------
RUN apk --update --no-cache add \
apache2-utils \
bash \
build-base \
curl \
g++ \
git \
libxml2-dev \
make \
npm \
nodejs \
openssl-dev \
python \
python-dev \
py-pip \
sshfs \
supervisor \
tmux \
wget
RUN git clone https://github.com/c9/core.git /cloud9 \
&& curl -s -L https://raw.githubusercontent.com/c9/install/master/link.sh | bash \
&& /cloud9/scripts/install-sdk.sh \
&& sed -i -e 's_127.0.0.1_0.0.0.0_g' /cloud9/configs/standalone.js \
&& mkdir /workspace \
&& mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/
# VOLUME /workspace
# ------------------------------------------------------------------------------
# Install Xtensa GCC toolchain
# ------------------------------------------------------------------------------
# Download and install glibc compatability
ENV GLIBC_VERSION 2.30-r0
RUN curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
curl -Lo glibc.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk" && \
curl -Lo glibc-bin.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk" && \
apk add glibc-bin.apk glibc.apk && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf glibc.apk glibc-bin.apk /var/cache/apk/*
RUN cd /tmp && \
mkdir -p /opt/esp-open-sdk && \
wget https://github.com/nodemcu/nodemcu-firmware/raw/2d958750b56fc60297f564b4ec303e47928b5927/tools/esp-open-sdk.tar.xz && \
tar -Jxvf esp-open-sdk.tar.xz && \
mv esp-open-sdk/xtensa-lx106-elf /opt/esp-open-sdk/. && \
rm esp-open-sdk.tar.xz && \
echo 'export PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH' >> /etc/profile.d/esp8266.sh
# ------------------------------------------------------------------------------
# Install Espressif NONOS SDK v2.0
# ------------------------------------------------------------------------------
RUN cd /tmp && \
wget http://bbs.espressif.com/download/file.php?id=1690 -O sdk.zip && \
unzip sdk.zip && \
mv `pwd`/ESP8266_NONOS_SDK/ /opt/esp-open-sdk/sdk && \
rm sdk.zip
# ------------------------------------------------------------------------------
# Set Environment
# ------------------------------------------------------------------------------
ENV PATH /opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
ENV XTENSA_TOOLS_ROOT /opt/esp-open-sdk/xtensa-lx106-elf/bin
ENV SDK_BASE /opt/esp-open-sdk/sdk
ENV FW_TOOL /opt/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py
ENV ESP_HOME /opt/esp-open-sdk
# ------------------------------------------------------------------------------
# Install ESP8266 Tools
# ------------------------------------------------------------------------------
# Install python-serial
RUN pip install pyserial
# Install esptool.py
RUN cd /tmp && \
wget https://github.com/espressif/esptool/archive/master.zip && \
unzip master.zip && \
mv esptool-master $ESP_HOME/esptool && rm master.zip
# Install esptool2
RUN cd $ESP_HOME && git clone https://github.com/raburton/esptool2 && cd $ESP_HOME/esptool2 && git checkout ec0e2c72952f4fa8242eedd307c58a479d845abe && \
cd $ESP_HOME/esptool2 && make && echo 'export PATH=$ESP_HOME/esptool2:$PATH' >> /etc/profile.d/esp8266.sh
ENV PATH $ESP_HOME/esptool2:$PATH
EXPOSE 80
SHELL ["/bin/bash", "-c"]
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration", "/etc/supervisord.conf"]