forked from clarkadamp/brewblox-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
173 lines (157 loc) · 5.38 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/debian/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/base:0-focal
RUN : \
&& apt-get update -q \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
curl \
wget \
software-properties-common \
&& apt-get update -q \
&& apt-get -y install --no-install-recommends \
autoconf \
automake \
bash-completion \
bear \
bison \
build-essential \
ca-certificates \
ccache \
check \
dfu-util \
flex \
g++-10 \
gcc-10 \
gcovr \
gdb \
git \
gperf \
jq \
lcov \
libboost-all-dev \
libffi-dev \
libncurses-dev \
libprotobuf-dev \
libpython2.7 \
libtool \
libusb-1.0-0-dev \
make \
ninja-build \
nodejs \
pkg-config \
protobuf-compiler \
python3 \
python3-pip \
python3-protobuf \
python-is-python3 \
ripgrep \
rsync \
shellcheck \
tzdata \
udev \
unzip \
usbutils \
xz-utils \
zip \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20 \
&& npm install -g \
lv_font_conv \
diff-so-fancy \
&& python3 -m pip install --upgrade \
autopep8 \
pip \
pyserial \
pyusb \
virtualenv \
&& :
# The CMake version in apt is significantly outdated
# Get binary dist from vendor
ARG CMAKE_VERSION=3.23.2
RUN : \
&& curl -sSL -o /tmp/cmake-installer.sh \
https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \
&& sh /tmp/cmake-installer.sh --skip-license --prefix=/usr/local/ \
&& :
# Set udev rules so we can flash Particle devices
RUN : \
&& mkdir -p /etc/udev/rules.d \
&& echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2b04", ATTRS{idProduct}=="[cd]00?", GROUP="plugdev", MODE="0666"' \
> /etc/udev/rules.d/50-particle.rules \
&& :
# install arm compiler (required for Particle builds)
ENV GCC_ARM_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2" \
GCC_ARM_VERSION="10.3-2021.07"
RUN : \
&& dpkg --add-architecture i386 \
&& apt-get update -q \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
isomd5sum \
bzip2 \
vim-common \
libarchive-zip-perl \
libc6:i386 \
&& curl -o /tmp/gcc-arm-none-eabi.tar.bz2 -sSL ${GCC_ARM_URL} \
&& tar xjvf /tmp/gcc-arm-none-eabi.tar.bz2 -C /usr/local \
&& mv /usr/local/gcc-arm-none-eabi-${GCC_ARM_VERSION}/ /usr/local/gcc-arm-embedded \
&& rm -rf /usr/local/gcc-arm-embedded/share \
&& :
ENV PATH /usr/local/gcc-arm-embedded/bin:$PATH
# download and compile boost and install as system includes (/usr/local)
ARG BOOST_VERSION=1_72_0
ENV BOOST_ROOT=/boost/boost_${BOOST_VERSION}
RUN : \
&& mkdir -p /boost \
&& curl -sSL https://s3.amazonaws.com/spark-assets/boost_$BOOST_VERSION.tar.gz | tar -xz -C /boost \
&& export DYLD_LIBRARY_PATH="$BOOST_ROOT/stage/lib:$DYLD_LIBRARY_PATH" \
&& export LD_LIBRARY_PATH="$BOOST_ROOT/stage/lib:$LD_LIBRARY_PATH" \
&& cd $BOOST_ROOT \
&& ./bootstrap.sh \
&& ./b2 --with-thread --with-system --with-program_options --with-random --with-regex --threading=multi link=static runtime-link=static \
&& :
# Install idf.py
ARG IDF_CLONE_URL=https://github.com/espressif/esp-idf.git
ARG IDF_CLONE_BRANCH_OR_TAG=v4.4.1
ARG IDF_CHECKOUT_REF=
ENV IDF_PATH=/opt/esp/idf
ENV IDF_TOOLS_PATH=/opt/esp
ENV IDF_CCACHE_ENABLE=1
RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_BRANCH_OR_TAG && \
git clone --recursive \
${IDF_CLONE_BRANCH_OR_TAG:+-b $IDF_CLONE_BRANCH_OR_TAG} \
$IDF_CLONE_URL $IDF_PATH && \
if [ -n "$IDF_CHECKOUT_REF" ]; then \
cd $IDF_PATH && \
git checkout $IDF_CHECKOUT_REF && \
git submodule update --init --recursive; \
fi
RUN : \
&& update-ca-certificates --fresh \
&& $IDF_PATH/tools/idf_tools.py --non-interactive install required \
&& $IDF_PATH/tools/idf_tools.py --non-interactive install cmake \
&& $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env \
&& rm -rf $IDF_TOOLS_PATH/dist \
&& :
# Give the user the required permissions for using USB devices
# Sets ownership of IDF dir to user to prevent git ownership errors
ARG USERNAME=vscode
RUN : \
&& usermod -aG dialout $USERNAME \
&& usermod -aG plugdev $USERNAME \
&& chown $USERNAME $IDF_PATH \
&& chown $USERNAME $IDF_PATH/components/openthread/openthread \
&& :
ARG SHFMT_VERSION=v3.4.2
RUN : \
&& curl -sSfL \
-o /usr/local/bin/shfmt \
https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64 \
&& chmod +x /usr/local/bin/shfmt \
&& :
RUN : \
&& . /opt/esp/idf/export.sh \
&& pip install --upgrade pyclang \
&& idf_tools.py install xtensa-clang \
&& :