Skip to content

Commit

Permalink
add a workaround so the build script works with podman
Browse files Browse the repository at this point in the history
  • Loading branch information
n-morales committed Dec 13, 2024
1 parent e31663c commit 79acf1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker-build-v2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,22 @@ if [[ -z "$(docker images -q $image 2> /dev/null)" ]]; then
docker pull $image
fi

# Podman assigns root id to the user so trying to set the user
# Won't work
check_is_podman() {
docker --version | grep -c "podman version"
}
set_usr_args=""
if [[ "$(check_is_podman)" -eq 0 ]]; then
echo "Using non-emulated docker"
set_usr_args="-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
--user=$(id -u):$(id -g)"
fi

docker run -it --rm \
-v $(pwd):/build/src:ro \
${set_usr_args} \
-v $(pwd)/.cache/ccache-$OS:/build/cache:rw \
-v $(pwd)/build-$OS:/build/out:rw \
-v $(pwd)/.conan2-$OS:/build/.conan2:rw \
Expand Down

0 comments on commit 79acf1d

Please sign in to comment.