Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(docker): separate tools installation in logical layers #60

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 39 additions & 24 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG CLANG_VERSION=14
ARG CPPCHECK_REPO=https://github.com/danmar/cppcheck.git
ARG CPPCHECK_VERSION=2.9

# install dependencies
# Install base dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
Expand All @@ -24,32 +24,47 @@ RUN apt-get update && apt-get install -y \
python3-pip \
yamllint \
pylint \
clang-format-$CLANG_VERSION \
clang-tidy-$CLANG_VERSION \
nodejs \
npm \
enchant-2 && \
pip3 install gitlint && \
pip3 install license-expression && \
pip3 install pyenchant && \
pip3 install sphinxcontrib-spelling && \
pip3 install sphinx-rtd-theme && \
pip3 install sphinx-tabs && \
pip3 install doc8 && \
pip3 install psutil && \
pip3 install pyserial && \
pip3 install pydevicetree && \
pip3 install doorstop && \
pip3 install pyspellchecker && \
pip3 install ROPgadget && \
pip3 install capstone && \
pip3 install GitPython && \
npm install -g cspell@latest && \
mkdir /opt/cppcheck && git clone $CPPCHECK_REPO --depth 1 --branch $CPPCHECK_VERSION /opt/cppcheck && make -C /opt/cppcheck FILESDIR=/usr/share/cppcheck && make -C /opt/cppcheck install FILESDIR=/usr/share/cppcheck && \
mkdir /opt/aarch64-toolchain && curl $AARCH64_TOOLCHAIN_LINK | tar xJ -C /opt/aarch64-toolchain --strip-components=1 && \
enchant-2 \
software-properties-common

# Install python packages
RUN pip3 install \
gitlint \
license-expression \
pyenchant \
sphinxcontrib-spelling \
sphinx-rtd-theme \
sphinx-tabs \
doc8 \
psutil \
pyserial \
pydevicetree \
doorstop \
pyspellchecker \
ROPgadget \
capstone \
GitPython

# Install javascript packages
RUN npm install -g cspell@latest

# Install static analyzers
# clang-format and clang-tidy
RUN apt-get install -y \
clang-format-$CLANG_VERSION \
clang-tidy-$CLANG_VERSION
# cppcheck
RUN mkdir /opt/cppcheck && git clone $CPPCHECK_REPO --depth 1 --branch $CPPCHECK_VERSION /opt/cppcheck && \
make -C /opt/cppcheck FILESDIR=/usr/share/cppcheck && make -C /opt/cppcheck install FILESDIR=/usr/share/cppcheck
# asmfmt
RUN mkdir /opt/asmfmt && curl -L $ASMFMT_LINK | tar xz -C /opt/asmfmt

# Install toolchains
RUN mkdir /opt/aarch64-toolchain && curl $AARCH64_TOOLCHAIN_LINK | tar xJ -C /opt/aarch64-toolchain --strip-components=1 && \
mkdir /opt/aarch32-toolchain && curl $AARCH32_TOOLCHAIN_LINK | tar xJ -C /opt/aarch32-toolchain --strip-components=1 && \
mkdir /opt/riscv-toolchain && curl $RISCV_TOOLCHAIN_LINK | tar xz -C /opt/riscv-toolchain --strip-components=1 && \
mkdir /opt/asmfmt && curl -L $ASMFMT_LINK | tar xz -C /opt/asmfmt
mkdir /opt/riscv-toolchain && curl $RISCV_TOOLCHAIN_LINK | tar xz -C /opt/riscv-toolchain --strip-components=1

# Add generic non-root user
RUN addgroup bao && adduser -disabled-password --ingroup bao bao
Expand Down