Skip to content

Commit

Permalink
Merge pull request #455 from vobst/improve-docker-image
Browse files Browse the repository at this point in the history
Improve docker image size and add LKM config
  • Loading branch information
vobst committed Apr 3, 2024
2 parents 3ee16dd + 6d2c6e8 commit d69cca6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/**/build
target/
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ FROM ghcr.io/fkie-cad/ghidra_headless_base:11.0.1 as runtime

RUN apt-get -y update \
&& apt-get -y install sudo \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/* \
&& useradd -m cwe \
&& echo "cwe:cwe" | chpasswd \
&& adduser cwe sudo \
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers

USER cwe

# Install all necessary files from the builder stage
COPY --from=builder /cwe_checker/target/release/cwe_checker /home/cwe/cwe_checker
COPY --from=builder /cwe_checker/src/config.json /home/cwe/.config/cwe_checker/config.json
COPY --from=builder /cwe_checker/src/lkm_config.json /home/cwe/.config/cwe_checker/lkm_config.json
COPY --from=builder /cwe_checker/src/ghidra/p_code_extractor /home/cwe/.local/share/cwe_checker/ghidra/p_code_extractor
RUN echo "{ \"ghidra_path\": \"/opt/ghidra\" }" | sudo tee /home/cwe/.config/cwe_checker/ghidra.json

Expand Down

0 comments on commit d69cca6

Please sign in to comment.