Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
c8e7c65
use non-root user
akashchi Feb 10, 2025
18a65ce
use non-root user
akashchi Feb 10, 2025
bcb864e
update tag
akashchi Feb 10, 2025
9ad579e
use id
akashchi Feb 10, 2025
546ffe1
install node
akashchi Feb 10, 2025
80e62c0
use another work dir
akashchi Feb 10, 2025
437fd33
specify work dir for container
akashchi Feb 10, 2025
1ff3b1f
spaces
akashchi Feb 10, 2025
3c75c6b
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Feb 12, 2025
96c1f1d
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Feb 13, 2025
b6575d1
setup node
akashchi Feb 13, 2025
ac0acfe
create workdir
akashchi Feb 13, 2025
9cf3b61
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Feb 19, 2025
3c76ba8
test job
akashchi Feb 19, 2025
c0ee5ab
w/o Docker
akashchi Feb 19, 2025
bb97bd7
different folder
akashchi Feb 19, 2025
d66754d
check id
akashchi Feb 19, 2025
fcd3a04
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Feb 20, 2025
7be7716
use 1000 as user
akashchi Feb 20, 2025
8240c43
rm workdir
akashchi Feb 20, 2025
fb79989
check id
akashchi Feb 20, 2025
cd45078
check with openvino
akashchi Feb 20, 2025
ee9e02f
combine commands
akashchi Feb 21, 2025
8e3c6ed
merge
akashchi Feb 25, 2025
d97545c
add rw
akashchi Feb 25, 2025
8efd601
check mount
akashchi Feb 25, 2025
2290259
merge
akashchi Mar 26, 2025
ff35ed8
try a non-root user with the test job
akashchi Mar 26, 2025
f32b7b0
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 1, 2025
b3afd93
use in samples
akashchi Apr 1, 2025
dcccc90
enable U22
akashchi Apr 1, 2025
6deb1e2
fix input for cxx job
akashchi Apr 1, 2025
6347b1e
mv clang installation to Docker
akashchi Apr 1, 2025
23ce9d3
merge
akashchi Apr 17, 2025
dc4e256
rm
akashchi Apr 17, 2025
f2a3f9c
use user-owned dir
akashchi Apr 17, 2025
8775b4d
mv package install from job to Docker
akashchi Apr 17, 2025
efc5875
add another missing lib
akashchi Apr 17, 2025
7375589
add missing packages, rm from the job
akashchi Apr 17, 2025
bdffab6
add non-root to U24
akashchi Apr 18, 2025
393fdea
merge
akashchi Apr 18, 2025
3bd6531
fix input for cxx job, rm dubplicate
akashchi Apr 18, 2025
a9d16d5
fix username
akashchi Apr 18, 2025
762ddc3
use group ID
akashchi Apr 18, 2025
dedf8d0
add to test image
akashchi Apr 18, 2025
2c570e4
add clang for samples
akashchi Apr 22, 2025
f7eea87
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 22, 2025
754f976
use non-root user in Android x64
akashchi Apr 22, 2025
29e0502
merge
akashchi Apr 22, 2025
9e3fef1
rm unused venv chown
akashchi Apr 22, 2025
85997e0
rm unneded chown
akashchi Apr 22, 2025
47aea0d
use non-root in Debian
akashchi Apr 22, 2025
b82ce45
fix input
akashchi Apr 22, 2025
5e36d33
rm /venv chown from the test Debian Dockerfile
akashchi Apr 22, 2025
db5b4ef
enable fedora
akashchi Apr 23, 2025
e4d7055
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 23, 2025
b37a92d
add clang
akashchi Apr 23, 2025
d1c2ec3
only clang
akashchi Apr 23, 2025
42d5c6e
use non-root in Linux arm
akashchi Apr 24, 2025
b05c35e
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 24, 2025
df64397
add packages
akashchi Apr 24, 2025
325c214
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 25, 2025
a15e53d
use non-root for dpcpp
akashchi Apr 25, 2025
ca2b9c4
rm unused
akashchi Apr 25, 2025
88f472e
update all setuptools
akashchi Apr 25, 2025
b6ce3c8
use non-root in build Dockerfiles
akashchi Apr 28, 2025
960c138
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 28, 2025
03ce6c8
fix incorrect configurations
akashchi Apr 28, 2025
d23cd96
fix group id
akashchi Apr 28, 2025
3aab437
setup buildx
akashchi Apr 28, 2025
b925a72
no volume cache
akashchi Apr 28, 2025
c67075d
check
akashchi Apr 29, 2025
ebe9074
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 29, 2025
90e6147
rootless docker
akashchi Apr 30, 2025
bd51003
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Apr 30, 2025
2f0b3f5
try w/o config
akashchi Apr 30, 2025
caa78af
create dir
akashchi Apr 30, 2025
52d52b0
use newer image
akashchi May 1, 2025
2225e2f
build w/o docker
akashchi May 1, 2025
ec88f35
skip
akashchi May 1, 2025
205add5
add dependencies, use the correct gcc
akashchi May 1, 2025
17dd3e8
headers
akashchi May 1, 2025
be97a56
merge
akashchi May 1, 2025
7f958d6
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 2, 2025
65e1a5d
specify linker
akashchi May 2, 2025
46184bb
fix cmake option
akashchi May 2, 2025
9032f47
install lld
akashchi May 2, 2025
b08b718
use cmake 3.26
akashchi May 2, 2025
d0d62d2
Update .github/workflows/manylinux_2014.yml
mryzhov May 2, 2025
58d138a
merge
akashchi May 8, 2025
79282f9
path w/o gcc-14
akashchi May 8, 2025
7c19e82
Update .github/workflows/manylinux_2014.yml
mryzhov May 8, 2025
5cc4c68
new LD_LIBRARY_PATH
akashchi May 9, 2025
10c7dc5
merge
akashchi May 9, 2025
59e707e
build py api outside docker
akashchi May 9, 2025
74112e2
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 9, 2025
992a978
merge
akashchi May 13, 2025
9cddfb2
skip storage
akashchi May 13, 2025
bf0e52d
comment out storage
akashchi May 13, 2025
0809d02
skip
akashchi May 13, 2025
425c582
add py3 to cmake
akashchi May 13, 2025
69d6519
ad dvars to Py API biulding
akashchi May 13, 2025
c2791be
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 13, 2025
af0ba69
merge
akashchi May 14, 2025
e829879
do not build gcc10, use the default one
akashchi May 14, 2025
efbff7d
rm flags
akashchi May 14, 2025
aab226e
warning as error off
akashchi May 14, 2025
bb41e1e
merge
akashchi May 15, 2025
864a16d
no dangling reference
akashchi May 15, 2025
77f60ef
update pip
akashchi May 15, 2025
fc05aca
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 19, 2025
8222f75
use non-root in test dockerfiles
akashchi May 19, 2025
b555aa8
try w/o warning
akashchi May 19, 2025
cdffcaa
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 19, 2025
eeb7e97
use 3.10 as default
akashchi May 19, 2025
d1a50e0
set OV dev package dir
akashchi May 20, 2025
084fcf5
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 20, 2025
3460f72
provide OV dir
akashchi May 21, 2025
ebb433f
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 21, 2025
a52394b
provide bin dir
akashchi May 21, 2025
51598cb
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 21, 2025
b37850c
build Pythons as non-root
akashchi May 27, 2025
2f83557
revert to root build for Python
akashchi May 29, 2025
0037423
merge
akashchi May 29, 2025
a1a65d6
rm
akashchi May 29, 2025
4c83239
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 29, 2025
d39081a
Merge branch 'master' into ci/gha/non-root-dockerfiles
akashchi May 29, 2025
4d87092
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi May 30, 2025
a34e9df
use gha runner
akashchi May 30, 2025
6bb6e66
Merge branch 'ci/gha/non-root-dockerfiles' of https://github.com/akas…
akashchi May 30, 2025
efc5c63
do not use py2
akashchi May 30, 2025
d980142
use non-root for manylinux
akashchi May 30, 2025
6070750
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Jun 3, 2025
8e482f2
use separate script
akashchi Jun 3, 2025
5815c3f
revert
akashchi Jun 3, 2025
312c6f4
merge
akashchi Jun 3, 2025
95ef8e2
revert
akashchi Jun 3, 2025
27128d6
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Jun 4, 2025
4b690e2
uncomment artefact storing
akashchi Jun 4, 2025
7e88baa
switch debian packages jobs to gh-hosted runners
akashchi Jun 4, 2025
c73fd02
Merge branch 'master' into ci/gha/non-root-dockerfiles
akashchi Jun 4, 2025
6f87fb2
Merge branch 'master' into ci/gha/non-root-dockerfiles
akashchi Jun 4, 2025
2b1fbaf
rm unused
akashchi Jun 4, 2025
ace95db
Merge branch 'master' into ci/gha/non-root-dockerfiles
akashchi Jun 5, 2025
faa4973
Merge remote-tracking branch 'upstream/master' into ci/gha/non-root-d…
akashchi Jun 6, 2025
9eb8f47
rm unused
akashchi Jun 6, 2025
73a5992
rm extra one
akashchi Jun 6, 2025
5d56e3f
Merge branch 'master' into ci/gha/non-root-dockerfiles
akashchi Jun 9, 2025
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
2 changes: 1 addition & 1 deletion .github/dockerfiles/docker_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pr-30691
pr-28903
17 changes: 17 additions & 0 deletions .github/dockerfiles/ov_build/debian_10_arm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/debian:10.13

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -227,3 +236,11 @@ RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"

ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
24 changes: 23 additions & 1 deletion .github/dockerfiles/ov_build/fedora_29/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/fedora:29

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# dnf configuration
RUN echo "timeout=60" >> /etc/dnf/dnf.conf && \
echo "retries=10" >> /etc/dnf/dnf.conf
Expand Down Expand Up @@ -88,7 +97,6 @@ ENV PATH="$SCCACHE_HOME:$PATH"
# Use Python 3.9 as default
RUN python3.9 -m venv venv
ENV PATH="/venv/bin:$PATH"
RUN alternatives --install /usr/bin/python python /usr/bin/python3.9 10

# Setup pip
ENV PIP_VERSION="24.0"
Expand Down Expand Up @@ -132,3 +140,17 @@ RUN wget -O git-2.49.0.tar.gz https://github.com/git/git/archive/refs/tags/v2.49
tar -zxf git-2.49.0.tar.gz
RUN cd git-2.49.0 && \
make configure && ./configure --prefix=/usr && make install

# Use python3.9 instead of /usr/bin/python
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Change ownership of node to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} ${NVM_DIR}

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
14 changes: 14 additions & 0 deletions .github/dockerfiles/ov_build/manylinux_2_28/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM openvinogithubactions.azurecr.io/quayio/pypa/manylinux_2_28

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

RUN yum groupinstall -y "Development Tools" && \
yum install -y wget bzip2 gcc-c++ libmpc-devel mpfr-devel gmp-devel cmake ccache ninja-build make tbb-devel ocl-icd-devel opencl-headers lld

Expand All @@ -18,3 +27,8 @@ RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \

# To make python3 and pip binaries accessible
ENV PATH="/opt/python/cp311-cp311/bin:$SCCACHE_HOME:$PATH"

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
20 changes: 20 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_20_04_arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:20.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -103,3 +112,14 @@ RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
ENV PATH="$NVM_DIR/versions/node/v${NODE_VERSION}/bin/:${PATH}"

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Change ownership of node to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} ${NVM_DIR}

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
28 changes: 27 additions & 1 deletion .github/dockerfiles/ov_build/ubuntu_20_04_x64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
ARG REGISTRY="docker.io"
FROM ${REGISTRY}/library/ubuntu:20.04

USER root
# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
Expand Down Expand Up @@ -79,3 +86,22 @@ RUN python3.9 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"

ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

# Install Node
ENV NODE_VERSION=21.7.3
ENV NVM_DIR=/.nvm
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
ENV PATH="$NVM_DIR/versions/node/v${NODE_VERSION}/bin/:${PATH}"

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Since the non-root user creation and directory ownership steps are repeated across many Dockerfiles, consider centralizing this logic or standardizing the approach across files to simplify future maintenance.

Copilot uses AI. Check for mistakes.

# Change ownership of node to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} ${NVM_DIR}

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/nvidia/cuda:11.8.0-runtime-ubuntu20.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -76,11 +85,19 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
curl https://bootstrap.pypa.io/pip/3.8/get-pip.py -o get-pip-3-8.py && \
python3.8 get-pip-3-8.py --no-cache-dir pip==${PIP_VERSION} && \
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py
rm -f get-pip.py get-pip-3.8.py

# Use Python 3.11 as default instead of Python 3.8
# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build
RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"

ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
14 changes: 14 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -54,3 +63,8 @@ ENV ANDROID_SDK_VERSION 29
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && \
unzip commandlinetools-linux-7583922_latest.zip
RUN echo "yes" | ./cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_TOOLS} --install "ndk-bundle" "platform-tools" "platforms;android-${ANDROID_SDK_VERSION}"

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
13 changes: 13 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_riscv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -72,3 +81,7 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -100,3 +109,11 @@ ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
26 changes: 26 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_x64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -71,6 +80,10 @@ RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE}

ENV PATH="$SCCACHE_HOME:$PATH"

# ONNX Runtime, see https://github.com/microsoft/onnxruntime/issues/13197#issuecomment-1264542497
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8

# Setup pip
ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
Expand Down Expand Up @@ -108,3 +121,16 @@ RUN mkdir -p ${DOXYGEN_HOME} && cd ${DOXYGEN_HOME} && wget https://www.doxygen.n
rm -f doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz
ENV PATH="${DOXYGEN_HOME}/doxygen-$DOXYGEN_VERSION/bin:$PATH"

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Change ownership of node to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} ${NVM_DIR}

# Change ownership of doxygen to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} ${DOXYGEN_HOME}

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
17 changes: 17 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -74,3 +83,11 @@ RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"

ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
17 changes: 17 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_x64_dpcpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM ${REGISTRY}/library/ubuntu:22.04

USER root

# Create a non-root user and group
ENV USER_NAME=runner
ENV USER_ID=1000
ENV GROUP_NAME=${USER_NAME}
ENV GROUP_ID=${USER_ID}

RUN groupadd -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd ${USER_NAME} -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
Expand Down Expand Up @@ -96,3 +105,11 @@ ENV CPATH=/opt/intel/oneapi/dpl/2022.6/include:/opt/intel/oneapi/dev-utilities/2
# Set Intel DPC++ as a default compiler
ENV CC=icx
ENV CXX=icpx

# Change ownership of the venv directory to the non-root user
RUN chown -R ${USER_NAME}:${USER_NAME} /venv

# Switch to the non-root user
USER ${USER_NAME}
Comment thread
akashchi marked this conversation as resolved.

WORKDIR /home/${USER_NAME}
Loading
Loading