Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Don't pass --user when rootless podman #30

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
17 changes: 13 additions & 4 deletions scripts/rundocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
SCRIPTDIR=$(realpath "$(dirname "$0")")
SRCDIR=$(dirname "$SCRIPTDIR")
DOCKER=${DOCKER:-"docker"}
IS_ROOTLESS_PODMAN=${IS_ROOTLESS_PODMAN:-true}

BUILD_CACHE_VOLUME=kolibri-android-cache
BUILD_CACHE_PATH=/cache
Expand All @@ -23,10 +24,6 @@ RUN_OPTS=(
--mount "type=bind,src=${SRCDIR},dst=${SRCDIR}"
--workdir "${SRCDIR}"

# Run as the calling user and make the cache volume the user's home
# directory so all the intermediate build outputs (e.g.,
# ~/.local/share/python-for-android and ~/.gradle) are stored.
--user "${BUILD_UID}:${BUILD_GID}"
--env HOME="${BUILD_CACHE_PATH}"

# Pass through other environment variables.
Expand All @@ -37,6 +34,18 @@ RUN_OPTS=(
--env ARCHES
)

if [ "${DOCKER}" = "podman" ] && [ "${IS_ROOTLESS_PODMAN}" = true ]; then
# Is rootless podman, nothing to do.
:
else
RUN_OPTS+=(
# Run as the calling user and make the cache volume the user's home
# directory so all the intermediate build outputs (e.g.,
# ~/.local/share/python-for-android and ~/.gradle) are stored.
--user "${BUILD_UID}:${BUILD_GID}"
)
fi

# If the release signing key has been specified and exists, ensure the
# path is absolute and bind mount it readonly into the container.
if [ -e "${P4A_RELEASE_KEYSTORE}" ]; then
Expand Down