2019-08-07 00:10:01 -04:00
|
|
|
#Download base image.
|
2022-10-03 15:56:04 -04:00
|
|
|
#The ubuntu:20.04 tag points to the "20.04 LTS"
|
|
|
|
FROM ubuntu:20.04
|
2019-08-07 00:10:01 -04:00
|
|
|
|
2019-12-29 04:02:03 -05: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/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2?revision=6e63531f-8cb1-40b9-bbfc-8a57cdfc01b4&la=en&hash=F761343D43A0587E8AC0925B723C04DBFB848339"
|
|
|
|
|
|
|
|
#Create volume /havocbin for compiled firmware binaries
|
|
|
|
VOLUME /havocbin
|
|
|
|
|
|
|
|
#Copy build context (repository root) to /havocsrc
|
|
|
|
COPY ./ /havocsrc
|
2019-08-07 00:10:01 -04:00
|
|
|
|
2019-12-29 04:02:03 -05:00
|
|
|
#Fetch dependencies from APT
|
|
|
|
RUN apt-get update && \
|
2023-03-27 10:22:20 -04:00
|
|
|
apt-get install -y tar wget dfu-util cmake python bzip2 lz4 curl python3 python3-yaml && \
|
2022-10-03 15:56:04 -04:00
|
|
|
apt-get -qy autoremove
|
2020-05-14 18:31:20 -04:00
|
|
|
|
2020-05-14 18:40:24 -04:00
|
|
|
#Install current pip from PyPa
|
2021-03-11 04:34:10 -05:00
|
|
|
RUN curl https://bootstrap.pypa.io/pip/3.4/get-pip.py -o get-pip.py && \
|
2022-10-03 15:56:04 -04:00
|
|
|
python get-pip.py
|
2020-05-14 18:31:20 -04:00
|
|
|
|
2019-12-29 04:02:03 -05:00
|
|
|
#Fetch additional dependencies from Python 2.x pip
|
2019-08-07 00:10:01 -04:00
|
|
|
RUN pip install pyyaml
|
2022-10-03 15:56:04 -04:00
|
|
|
RUN rm -rf /usr/bin/python && \
|
2023-02-19 02:35:25 -05:00
|
|
|
rm -rf /usr/bin/pip && \
|
|
|
|
ln -s /usr/bin/python3 /usr/bin/python && \
|
|
|
|
ln -s /usr/bin/pip3 /usr/bin/pip
|
2020-05-20 08:48:44 -04:00
|
|
|
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
ENV LC_ALL C.UTF-8
|
2019-08-07 00:10:01 -04:00
|
|
|
|
2019-12-29 04:02:03 -05:00
|
|
|
#Grab the GNU ARM toolchain from arm.com
|
|
|
|
#Then extract contents to /opt/build/armbin/
|
|
|
|
RUN mkdir /opt/build && cd /opt/build && \
|
2022-10-03 15:56:04 -04:00
|
|
|
wget -O gcc-arm-none-eabi $ARMBINURL && \
|
|
|
|
mkdir armbin && \
|
|
|
|
tar --strip=1 -xjvf gcc-arm-none-eabi -C armbin
|
2023-02-19 02:35:25 -05:00
|
|
|
|
2019-12-29 04:02:03 -05:00
|
|
|
#Set environment variable so compiler knows where the toolchain lives
|
|
|
|
ENV PATH=$PATH:/opt/build/armbin/bin
|
|
|
|
|
|
|
|
CMD cd /havocsrc && \
|
2023-02-19 02:35:25 -05:00
|
|
|
mkdir build && cd build && \
|
|
|
|
cmake .. && make firmware && \
|
|
|
|
cp /portapack-havoc/firmware/portapack-h1-havoc.bin /havocbin
|
2022-10-03 15:56:04 -04:00
|
|
|
|