2020-04-25 09:45:37 -04:00
|
|
|
FROM ubuntu:xenial
|
2020-04-25 08:47:31 -04:00
|
|
|
|
|
|
|
# Set location to download ARM toolkit from.
|
|
|
|
# This will need to be changed over time or replaced with a static link to the latest release.
|
|
|
|
ENV ARMBINURL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2?revision=108bd959-44bd-4619-9c19-26187abf5225&la=en&hash=E788CE92E5DFD64B2A8C246BBA91A249CB8E2D2D \
|
|
|
|
PATH=$HOME/bin:$PATH:/opt/build/armbin/bin
|
|
|
|
|
|
|
|
#Create volume /havoc/bin for compiled firmware binaries
|
|
|
|
VOLUME /havoc
|
|
|
|
WORKDIR /havoc/firmware
|
|
|
|
|
|
|
|
# Fetch dependencies from APT
|
|
|
|
RUN apt-get update && \
|
2020-05-20 08:48:44 -04:00
|
|
|
apt-get install -y git tar wget dfu-util cmake python3 ccache bzip2 curl && \
|
2020-04-25 08:47:31 -04:00
|
|
|
apt-get -qy autoremove
|
|
|
|
|
2020-05-14 18:40:24 -04:00
|
|
|
#Install current pip from PyPa
|
2021-03-11 04:33:54 -05:00
|
|
|
RUN curl https://bootstrap.pypa.io/pip/3.4/get-pip.py -o get-pip.py && \
|
2020-05-14 19:08:23 -04:00
|
|
|
python3 get-pip.py
|
2020-05-14 18:31:20 -04:00
|
|
|
|
2020-05-14 18:40:24 -04:00
|
|
|
#Fetch additional dependencies from Python 3.x pip
|
2020-04-25 08:47:31 -04:00
|
|
|
RUN pip install pyyaml
|
2020-05-20 08:48:44 -04:00
|
|
|
RUN ln -s /usr/bin/python3 /usr/bin/python && \
|
|
|
|
ln -s /usr/bin/pip3 /usr/bin/pip
|
|
|
|
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
ENV LC_ALL C.UTF-8
|
2020-04-25 08:47:31 -04:00
|
|
|
|
|
|
|
# Grab the GNU ARM toolchain from arm.com
|
|
|
|
# Then extract contents to /opt/build/armbin/
|
|
|
|
RUN mkdir /opt/build && cd /opt/build && \
|
|
|
|
wget -O gcc-arm-none-eabi $ARMBINURL && \
|
|
|
|
mkdir armbin && \
|
|
|
|
tar --strip=1 -xjvf gcc-arm-none-eabi -C armbin
|
|
|
|
|
|
|
|
# Configure CCACHE
|
|
|
|
RUN mkdir ~/bin && cd ~/bin && \
|
|
|
|
for tool in gcc g++ cpp c++;do ln -s $(which ccache) arm-none-eabi-$tool;done
|
|
|
|
|
|
|
|
CMD cd .. && cd build && \
|
2021-02-16 03:49:48 -05:00
|
|
|
cmake .. && make firmware
|