From b2d11d6e0b5027b1e612fbe5619efea4ab5ebd0b Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Fri, 25 Oct 2024 15:26:52 +0800 Subject: [PATCH] add user and group to ovn container image to rebuild for dpdk file access fix #1982 --- images/ovn/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/images/ovn/Dockerfile b/images/ovn/Dockerfile index de7a8e817..ef69e2a81 100644 --- a/images/ovn/Dockerfile +++ b/images/ovn/Dockerfile @@ -34,3 +34,11 @@ EOF COPY --from=ovn-kubernetes --link /src/dist/images/ovndb-raft-functions.sh /root/ovndb-raft-functions.sh COPY --from=ovn-kubernetes --link /src/dist/images/ovnkube.sh /root/ovnkube.sh COPY --from=ovn-kubernetes --link /usr/bin/ovn-kube-util /usr/bin/ovn-kube-util + +ARG PROJECT=ovn +ENV OVS_USER_ID=42424 +RUN \ + groupadd -g 42424 ${PROJECT} && \ + useradd -u 42424 -g 42424 -M -d /var/lib/${PROJECT} -s ${SHELL} -c "${PROJECT} User" ${PROJECT} && \ + mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} && \ + chown -Rv ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT}