Parcourir la source

Fix Android-build using DBE with Podman.
Do not explicitly name the container so that a same DBE image can be spawned multiple times at the same time.

[ci skip]

Yao Wei Tjong 姚伟忠 il y a 6 ans
Parent
commit
646c059620
1 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 2 3
      script/dockerized.sh

+ 2 - 3
script/dockerized.sh

@@ -37,6 +37,7 @@ BuildEnvironment=${BuildEnvironment/-base}
 if ! docker --version >/dev/null 2>&1; then
 if ! docker --version >/dev/null 2>&1; then
     if podman --version >/dev/null 2>&1; then
     if podman --version >/dev/null 2>&1; then
         use_podman=1
         use_podman=1
+        mount_option=,exec  # Podman mount volume as 'noexec' by default but we need 'exec' for Android build (aapt2 permission denied otherwise)
     else
     else
         echo "Could not find Docker client or podman"
         echo "Could not find Docker client or podman"
         exit 1
         exit 1
@@ -61,8 +62,7 @@ if [[ $use_podman ]] || ( [[ $(d version -f '{{.Client.Version}}') =~ ^([0-9]+)\
         -e HOST_UID="$(id -u)" -e HOST_GID="$(id -g)" -e PROJECT_DIR="$PROJECT_DIR" \
         -e HOST_UID="$(id -u)" -e HOST_GID="$(id -g)" -e PROJECT_DIR="$PROJECT_DIR" \
         --env-file "$PROJECT_DIR/script/.env-file" \
         --env-file "$PROJECT_DIR/script/.env-file" \
         --mount type=bind,source="$PROJECT_DIR",target="$PROJECT_DIR" \
         --mount type=bind,source="$PROJECT_DIR",target="$PROJECT_DIR" \
-        --mount type=volume,source="$(id -u).urho3d_home_dir",target=/home/urho3d \
-        --name "dockerized$BuildEnvironment" \
+        --mount type=volume,source="$(id -u).urho3d_home_dir",target=/home/urho3d$mount_option \
         "urho3d/dockerized$BuildEnvironment:$DBE_TAG" "$@"
         "urho3d/dockerized$BuildEnvironment:$DBE_TAG" "$@"
 else
 else
     # Fallback workaround on older Docker CLI version
     # Fallback workaround on older Docker CLI version
@@ -71,7 +71,6 @@ else
         --env-file <(perl -ne 'chomp; print "$_\n" if defined $ENV{$_}' "$PROJECT_DIR/script/.env-file") \
         --env-file <(perl -ne 'chomp; print "$_\n" if defined $ENV{$_}' "$PROJECT_DIR/script/.env-file") \
         --mount type=bind,source="$PROJECT_DIR",target="$PROJECT_DIR" \
         --mount type=bind,source="$PROJECT_DIR",target="$PROJECT_DIR" \
         --mount type=volume,source="$(id -u).urho3d_home_dir",target=/home/urho3d \
         --mount type=volume,source="$(id -u).urho3d_home_dir",target=/home/urho3d \
-        --name "dockerized$BuildEnvironment" \
         "urho3d/dockerized$BuildEnvironment:$DBE_TAG" "$@"
         "urho3d/dockerized$BuildEnvironment:$DBE_TAG" "$@"
 fi
 fi