portapack-mayhem/dockerfile-nogit

31 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-04-24 21:00:00 -04:00
FROM ubuntu:latest
# 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 \
2020-04-24 22:04:38 -04:00
PATH=$HOME/bin:$PATH:/opt/build/armbin/bin
2020-04-24 21:00:00 -04:00
#Create volume /havoc/bin for compiled firmware binaries
VOLUME /havoc
WORKDIR /havoc/firmware
# Fetch dependencies from APT
RUN apt-get update && \
2020-04-24 22:04:38 -04:00
apt-get install -y git tar wget dfu-util cmake python3 python-pip ccache && \
2020-04-24 21:00:00 -04:00
apt-get -qy autoremove
RUN pip install pyyaml
# 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
2020-04-24 22:04:38 -04:00
# Configure CCACHE
RUN mkdir ~/bin && cd ~/bin && \
for tool in gcc g++ cpp c++;do ln -s $(which ccache) arm-none-eabi-$tool;done
2020-04-24 21:00:00 -04:00
CMD cd .. && cd build && \
cmake .. && make firmware