Skip to content
Snippets Groups Projects
Unverified Commit d9fb802a authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts: container.sh: keep UID/GID of host user in container

Fixes access to the build directory mounted into the container when UIDs
don't match.

For Docker, HOME is set in addition to get a more useful value than /
and for consistency with Podman.
parent 0db797cd
No related branches found
No related tags found
No related merge requests found
......@@ -12,11 +12,11 @@ TAG="gluon:${BRANCH:-latest}"
if [ "$(command -v podman)" ]
then
podman build -t "${TAG}" contrib/docker
podman run -it --rm --userns=keep-id --volume="$(pwd):/gluon" "${TAG}"
podman run -it --rm -u "$(id -u):$(id -g)" --userns=keep-id --volume="$(pwd):/gluon" "${TAG}"
elif [ "$(command -v docker)" ]
then
docker build -t "${TAG}" contrib/docker
docker run -it --rm --volume="$(pwd):/gluon" "${TAG}"
docker run -it --rm -u "$(id -u):$(id -g)" --volume="$(pwd):/gluon" -e HOME=/gluon "${TAG}"
else
1>&2 echo "Please install either podman or docker. Exiting" >/dev/null
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment