Skip to content

Commit ff333a1

Browse files
committed
Fix trivy reported issues in a new docker file
1 parent be4e0c6 commit ff333a1

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

devops/containers/ubuntu2404_build_oneapi.Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,17 @@ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCT
3232
| tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
3333
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
3434
| tee /etc/apt/sources.list.d/oneAPI.list && \
35-
apt update
3635
# Install the ROCM kernel driver and oneAPI
37-
RUN apt install -yqq rocm-dev intel-oneapi-compiler-dpcpp-cpp && \
36+
RUN apt update && apt install -yqq rocm-dev intel-oneapi-compiler-dpcpp-cpp && \
3837
apt-get clean && \
3938
rm -rf /var/lib/apt/lists/*
4039

41-
# By default Ubuntu sets an arbitrary UID value, that is different from host
42-
# system. When CI passes default UID value of 1001, some of LLVM tools fail to
43-
# discover user home directory and fail a few LIT tests. Fixes UID and GID to
44-
# 1001, that is used as default by GitHub Actions.
45-
RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
46-
# Add sycl user to video/irc groups so that it can access GPU
47-
RUN usermod -aG video sycl
48-
RUN usermod -aG irc sycl
40+
COPY scripts/create-sycl-user.sh /user-setup.sh
41+
RUN --mount=type=secret,id=sycl_ci_passwd /user-setup.sh
4942

5043
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
5144

45+
USER sycl_ci
46+
5247
ENTRYPOINT ["/docker_entrypoint.sh"]
5348

0 commit comments

Comments
 (0)