Skip to content
Snippets Groups Projects
Commit a37d8cd1 authored by Brian Lechthaler's avatar Brian Lechthaler Committed by Furrtek
Browse files

dockerfile improvements (#296)

**Summary of changes:**

 - Added *some* inline documentation to make things a little more understandable
 - Replaced ARM toolchain dependency fetching, see #274 
 - Environment variable included to specify new or custom ARM toolchain. As ARM releases new versions of the toolchain, this URL can be changed.
parent 94405389
No related branches found
No related tags found
No related merge requests found
#Download base image. #Download base image.
#The ubuntu:latest tag points to the "latest LTS" #The ubuntu:latest tag points to the "latest LTS"
FROM ubuntu:latest FROM ubuntu:latest
VOLUME /myvol
RUN apt-get update && \ #Set location to download ARM toolkit from.
apt-get install -y software-properties-common && \ # This will need to be changed over time or replaced with a static link to the latest release.
apt-get install -y apt-transport-https 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
# #Fetch dependencies from APT
RUN add-apt-repository ppa:team-gcc-arm-embedded/ppa && apt-get update && apt-get install -y gcc-arm-embedded dfu-util cmake git python python-pip && apt-get -qy autoremove RUN apt-get update && \
apt-get install -y tar wget dfu-util cmake python python-pip && \
apt-get -qy autoremove
#Fetch additional dependencies from Python 2.x pip
RUN pip install pyyaml RUN pip install pyyaml
CMD git clone https://github.com/furrtek/portapack-havoc.git portapack-havoc && cd portapack-havoc && mkdir build && cd build && cmake .. && make firmware && cp /portapack-havoc/firmware/portapack-h1-havoc.bin /myvol #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
#Set environment variable so compiler knows where the toolchain lives
ENV PATH=$PATH:/opt/build/armbin/bin
CMD cd /havocsrc && \
mkdir build && cd build && \
cmake .. && make firmware && \
cp /portapack-havoc/firmware/portapack-h1-havoc.bin /havocbin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment