Skip to content

Commit

Permalink
chore: define user directory for binaries (#117)
Browse files Browse the repository at this point in the history
* chore: define user directory for binaries

Signed-off-by: Vitaliy Gulyy <[email protected]>
  • Loading branch information
vitaliy-guliy authored Sep 6, 2023
1 parent 1f83bab commit 4304474
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion universal/ubi8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ ENV KUBECONFIG=/home/user/.kube/config

USER 0

# Define user directory for binaries
RUN mkdir -p /home/user/.local/bin && \
chgrp -R 0 /home && chmod -R g=u /home
ENV PATH="/home/user/.local/bin:$PATH"

# Required packages for AWT
RUN dnf install -y libXext libXrender libXtst libXi

Expand Down Expand Up @@ -445,7 +450,7 @@ rm -rf "${TEMP_DIR}"
EOF

# Set permissions on /etc/passwd and /home to allow arbitrary users to write
RUN mkdir -p /home/user && chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home
RUN chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home

# cleanup dnf cache
RUN dnf -y clean all --enablerepo='*'
Expand Down
2 changes: 0 additions & 2 deletions universal/ubi8/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ if [ "${KUBEDOCK_ENABLED:-false}" = "true" ]; then

echo "Replacing podman with podman-wrapper..."

mkdir -p /home/user/.local/bin/
ln -f -s /usr/bin/podman.wrapper /home/user/.local/bin/podman

export TESTCONTAINERS_RYUK_DISABLED="true"
Expand All @@ -39,7 +38,6 @@ else
echo "Kubedock is disabled. It can be enabled with the env variable \"KUBEDOCK_ENABLED=true\""
echo "set in the workspace Devfile or in a Kubernetes ConfigMap in the developer namespace."
echo
mkdir -p /home/user/.local/bin/
ln -f -s /usr/bin/podman.orig /home/user/.local/bin/podman
fi

Expand Down

0 comments on commit 4304474

Please sign in to comment.