Skip to content

Commit a1fe5f0

Browse files
authored
Dockerfile: fix copying ispm config file to vscode user (#231)
1 parent 725e976 commit a1fe5f0

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/scans.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,38 @@ jobs:
6868
scan_main_container:
6969
runs-on: ubuntu-latest
7070
steps:
71+
- name: Aggressive cleanup
72+
run: |
73+
# Remove Java (JDKs)
74+
sudo rm -rf /usr/lib/jvm
75+
76+
# Remove .NET SDKs
77+
sudo rm -rf /usr/share/dotnet
78+
79+
# Remove Swift toolchain
80+
sudo rm -rf /usr/share/swift
81+
82+
# Remove Haskell (GHC)
83+
sudo rm -rf /usr/local/.ghcup
84+
85+
# Remove Julia
86+
sudo rm -rf /usr/local/julia*
87+
88+
# Remove Android SDKs
89+
sudo rm -rf /usr/local/lib/android
90+
91+
# Remove Chromium (optional if not using for browser tests)
92+
sudo rm -rf /usr/local/share/chromium
93+
94+
# Remove Microsoft/Edge and Google Chrome builds
95+
sudo rm -rf /opt/microsoft /opt/google
96+
97+
# Remove Azure CLI
98+
sudo rm -rf /opt/az
99+
100+
# Remove PowerShell
101+
sudo rm -rf /usr/local/share/powershell
102+
71103
- name: Harden Runner
72104
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
73105
with:

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,15 @@ cp /workspace/tsffs/harness/tsffs.h /workspace/projects/example/
204204
ninja
205205
EOF
206206

207+
208+
RUN <<EOF
209+
set -e
210+
# copy ISPM config to vscode user
211+
cp -r "/root/.config" "/home/${USERNAME}/.config"
212+
chown -R "${USERNAME}:dev" "/home/${USERNAME}/.config"
213+
EOF
214+
207215
USER vscode
208-
RUN echo 'echo "To run the demo, run ./simics -no-gui --no-win fuzz.simics"' >> ~/.bashrc
209216

210217
WORKDIR /workspace/tsffs
211218

@@ -214,6 +221,7 @@ FROM create-user AS tsffs-prod
214221
ARG PUBLIC_SIMICS_PKGS_URL
215222
ARG PUBLIC_SIMICS_ISPM_URL
216223
ARG PUBLIC_SIMICS_PACKAGE_VERSION_1000
224+
ARG USERNAME
217225
ENV SIMICS_BASE="/workspace/simics/simics-${PUBLIC_SIMICS_PACKAGE_VERSION_1000}/"
218226
# Add cargo and ispm to the path
219227
ENV PATH="/home/${USERNAME}/.cargo/bin:/workspace/simics/ispm:${PATH}"
@@ -249,4 +257,5 @@ RUN rm -r /workspace/tsffs
249257
RUN chmod 775 /workspace
250258

251259
USER vscode
260+
RUN echo 'echo "To run the demo, run ./simics -no-gui --no-win fuzz.simics"' >> "/home/${USERNAME}/.bashrc"
252261
WORKDIR /workspace/projects/example

0 commit comments

Comments
 (0)