From 1ed603c90412fcce02eab3a53d25d0ff1a3cd91a Mon Sep 17 00:00:00 2001 From: Canming Huang Date: Tue, 10 Sep 2024 15:43:43 -0400 Subject: [PATCH] Fixed docker build script --- platforms/ubuntu/docker/docker_build_emgutf | 14 ++++++++---- platforms/ubuntu/docker/docker_build_tf | 22 ++++++++++++++----- .../ubuntu/docker/docker_build_tf_android | 13 ++++++++--- platforms/ubuntu/docker/docker_build_tflite | 19 +++++++++++----- .../ubuntu/docker/docker_build_tflite_android | 13 ++++++++--- 5 files changed, 59 insertions(+), 22 deletions(-) diff --git a/platforms/ubuntu/docker/docker_build_emgutf b/platforms/ubuntu/docker/docker_build_emgutf index 2ce85b654..75df2a3e0 100755 --- a/platforms/ubuntu/docker/docker_build_emgutf +++ b/platforms/ubuntu/docker/docker_build_emgutf @@ -4,13 +4,19 @@ cd "$(dirname "$0")" cd ../../.. +USER_ID=$(id -u) +USER_NAME=$(whoami) + +echo "USER_ID=$USER_ID" +echo "USER_NAME=$USER_NAME" + docker run \ - -e USER="$(id -u)" \ - -u="$(id -u)" \ + -e USER="$USER_ID" \ + -u="$USER_ID" \ -v $(pwd):/src/workspace \ -v /etc/passwd:/etc/passwd \ - -w /src/workspace/platforms/ubuntu/22.04 \ - emgu/bazel-android:dotnet-6.0-bazel-5.0.0-ubuntu-22.04 \ + -w /src/workspace/platforms/ubuntu/24.04 \ + emgu/bazel-android:ubuntu-24.04-dotnet-8-bazelisk \ ./build_emgutf diff --git a/platforms/ubuntu/docker/docker_build_tf b/platforms/ubuntu/docker/docker_build_tf index 8d366590d..c884ac3c9 100755 --- a/platforms/ubuntu/docker/docker_build_tf +++ b/platforms/ubuntu/docker/docker_build_tf @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -v cd "$(dirname "$0")" @@ -6,12 +6,22 @@ mkdir -p /tmp/build_output cd ../../.. +USER_ID=$(id -u) +USER_NAME=$(whoami) + +echo "USER_ID=$USER_ID" +echo "USER_NAME=$USER_NAME" + docker run \ - -e USER="$(id -u)" \ - -u="$(id -u)" \ + -e USER="$USER_ID" \ + -u="$USER_ID" \ -v $(pwd):/src/workspace \ + -v /home/$USER_NAME/.cache/bazelisk:/home/$USER_NAME/.cache/bazelisk \ -v /tmp/build_output:/tmp/build_output \ -v /etc/passwd:/etc/passwd \ - -w /src/workspace/platforms/ubuntu/22.04 \ - emgu/bazel-android:dotnet-6.0-bazel-5.0.0-ubuntu-22.04 \ - ./bazel_build_tf + -w /src/workspace/platforms/ubuntu/24.04 \ + emgu/bazel-android:ubuntu-24.04-dotnet-8-bazelisk \ + bash -c "./bazel_build_tf" + + + diff --git a/platforms/ubuntu/docker/docker_build_tf_android b/platforms/ubuntu/docker/docker_build_tf_android index f8841b8b5..c94e0a0e6 100755 --- a/platforms/ubuntu/docker/docker_build_tf_android +++ b/platforms/ubuntu/docker/docker_build_tf_android @@ -13,13 +13,20 @@ mkdir -p /tmp/build_output cd ../../.. +USER_ID=$(id -u) +USER_NAME=$(whoami) + +echo "USER_ID=$USER_ID" +echo "USER_NAME=$USER_NAME" + docker run \ - -e USER="$(id -u)" \ - -u="$(id -u)" \ + -e USER="$USER_ID" \ + -u="$USER_ID" \ -v $(pwd):/src/workspace \ + -v /home/$USER_NAME/.cache/bazelisk:/home/$USER_NAME/.cache/bazelisk \ -v /tmp/build_output:/tmp/build_output \ -v /etc/passwd:/etc/passwd \ -w /src/workspace/platforms/android \ - emgu/bazel-android:dotnet-6.0-bazel-5.0.0-ubuntu-22.04 \ + emgu/bazel-android:ubuntu-24.04-dotnet-8-bazelisk \ ./build_tf_android $1 diff --git a/platforms/ubuntu/docker/docker_build_tflite b/platforms/ubuntu/docker/docker_build_tflite index 2a2786b4a..94927649c 100755 --- a/platforms/ubuntu/docker/docker_build_tflite +++ b/platforms/ubuntu/docker/docker_build_tflite @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -v cd "$(dirname "$0")" @@ -6,14 +6,21 @@ mkdir -p /tmp/build_output cd ../../.. +USER_ID=$(id -u) +USER_NAME=$(whoami) + +echo "USER_ID=$USER_ID" +echo "USER_NAME=$USER_NAME" + docker run \ - -e USER="$(id -u)" \ - -u="$(id -u)" \ + -e USER="$USER_ID" \ + -u="$USER_ID" \ -v $(pwd):/src/workspace \ + -v /home/$USER_NAME/.cache/bazelisk:/home/$USER_NAME/.cache/bazelisk \ -v /tmp/build_output:/tmp/build_output \ -v /etc/passwd:/etc/passwd \ - -w /src/workspace/platforms/ubuntu/22.04 \ - emgu/bazel-android:dotnet-6.0-bazel-5.0.0-ubuntu-22.04 \ - ./bazel_build_tflite + -w /src/workspace/platforms/ubuntu/24.04 \ + emgu/bazel-android:ubuntu-24.04-dotnet-8-bazelisk \ + bash -c "./bazel_build_tflite" diff --git a/platforms/ubuntu/docker/docker_build_tflite_android b/platforms/ubuntu/docker/docker_build_tflite_android index 2d0b5e144..9a5404c1d 100755 --- a/platforms/ubuntu/docker/docker_build_tflite_android +++ b/platforms/ubuntu/docker/docker_build_tflite_android @@ -13,13 +13,20 @@ mkdir -p /tmp/build_output cd ../../.. +USER_ID=$(id -u) +USER_NAME=$(whoami) + +echo "USER_ID=$USER_ID" +echo "USER_NAME=$USER_NAME" + docker run \ - -e USER="$(id -u)" \ - -u="$(id -u)" \ + -e USER="$USER_ID" \ + -u="$USER_ID" \ -v $(pwd):/src/workspace \ + -v /home/$USER_NAME/.cache/bazelisk:/home/$USER_NAME/.cache/bazelisk \ -v /tmp/build_output:/tmp/build_output \ -v /etc/passwd:/etc/passwd \ -w /src/workspace/platforms/android/ \ - emgu/bazel-android:dotnet-6.0-bazel-5.0.0-ubuntu-22.04 \ + emgu/bazel-android:ubuntu-24.04-dotnet-8-bazelisk \ ./build_tflite_android $1