From 214080e7f957d743b5ab06874d86b11a64d431e4 Mon Sep 17 00:00:00 2001 From: Valentin Obst Date: Tue, 2 Apr 2024 08:31:28 +0200 Subject: [PATCH 1/3] docker/artificial_samples: reorder cc-install script and copy --- test/artificial_samples/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/artificial_samples/Dockerfile b/test/artificial_samples/Dockerfile index e908f6df5..46ea77908 100644 --- a/test/artificial_samples/Dockerfile +++ b/test/artificial_samples/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get -y update \ && 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 RUN sudo apt-get install python3-pip apt-utils -y @@ -17,8 +17,10 @@ RUN sudo pip3 install scons ENV PATH="/home/cwe/.local/bin/:${PATH}" +COPY ./install_cross_compilers.sh . + +RUN ./install_cross_compilers.sh + COPY . /home/cwe/artificial_samples/ WORKDIR /home/cwe/artificial_samples/ - -RUN ./install_cross_compilers.sh \ No newline at end of file From 4cc2a105e731c1a0619b5f2fd4a6ce723f297cdf Mon Sep 17 00:00:00 2001 From: Valentin Obst Date: Tue, 2 Apr 2024 11:26:19 +0200 Subject: [PATCH 2/3] docker/artificial_samples: chown copied files --- test/artificial_samples/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/artificial_samples/Dockerfile b/test/artificial_samples/Dockerfile index 46ea77908..9164e1ce8 100644 --- a/test/artificial_samples/Dockerfile +++ b/test/artificial_samples/Dockerfile @@ -17,10 +17,10 @@ RUN sudo pip3 install scons ENV PATH="/home/cwe/.local/bin/:${PATH}" -COPY ./install_cross_compilers.sh . +COPY --chown=cwe:cwe ./install_cross_compilers.sh . RUN ./install_cross_compilers.sh -COPY . /home/cwe/artificial_samples/ +COPY --chown=cwe:cwe . /home/cwe/artificial_samples/ WORKDIR /home/cwe/artificial_samples/ From f64ad831b0c9ff8c6114ebd62875fde6539a0824 Mon Sep 17 00:00:00 2001 From: Valentin Obst Date: Tue, 2 Apr 2024 11:59:45 +0200 Subject: [PATCH 3/3] docker/artificial_samples: reduce image size --- test/artificial_samples/.dockerignore | 2 ++ test/artificial_samples/install_cross_compilers.sh | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 test/artificial_samples/.dockerignore diff --git a/test/artificial_samples/.dockerignore b/test/artificial_samples/.dockerignore new file mode 100644 index 000000000..1512740c9 --- /dev/null +++ b/test/artificial_samples/.dockerignore @@ -0,0 +1,2 @@ +build/*.out +build/*.o diff --git a/test/artificial_samples/install_cross_compilers.sh b/test/artificial_samples/install_cross_compilers.sh index 35fbf7a9c..b2578fbed 100755 --- a/test/artificial_samples/install_cross_compilers.sh +++ b/test/artificial_samples/install_cross_compilers.sh @@ -33,4 +33,7 @@ sudo apt install -y clang sudo ln -s /usr/include/asm-generic /usr/include/asm +echo "Cleaning package index." +sudo apt-get clean && sudo rm -rf /var/cache/apt/archives /var/lib/apt/lists/* + echo "Done."