From c490050599aef24e7d82e5db33d920ac58e93495 Mon Sep 17 00:00:00 2001 From: Amadeusz Szymko Date: Mon, 23 Dec 2024 16:58:03 +0900 Subject: [PATCH] fix(docker): update build script with respect to multi-container design (#5571) --- docker/build.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index b962137b79c..d0d8b8976eb 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -59,9 +59,9 @@ set_cuda_options() { # Set build options set_build_options() { if [ "$option_devel_only" = "true" ]; then - targets=("universe-devel") + target="universe-devel" else - targets=() + target="universe" fi } @@ -121,10 +121,10 @@ build_images() { echo "Setup args: $setup_args" echo "Lib dir: $lib_dir" echo "Image name suffix: $image_name_suffix" - echo "Targets: ${targets[*]}" + echo "Target: $target" set -x - docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake.hcl" \ + docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake-base.hcl" \ --set "*.context=$WORKSPACE_ROOT" \ --set "*.ssh=default" \ --set "*.platform=$platform" \ @@ -132,10 +132,23 @@ build_images() { --set "*.args.BASE_IMAGE=$base_image" \ --set "*.args.SETUP_ARGS=$setup_args" \ --set "*.args.LIB_DIR=$lib_dir" \ - --set "base.tags=ghcr.io/autowarefoundation/autoware:base" \ - --set "universe-devel.tags=ghcr.io/autowarefoundation/autoware:universe-devel$image_name_suffix" \ - --set "universe.tags=ghcr.io/autowarefoundation/autoware:universe$image_name_suffix" \ - "${targets[@]}" + --set "base.tags=ghcr.io/autowarefoundation/autoware-base:latest" \ + --set "base-cuda.tags=ghcr.io/autowarefoundation/autoware-base:cuda-latest" + docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake.hcl" -f "$SCRIPT_DIR/docker-bake-cuda.hcl" \ + --set "*.context=$WORKSPACE_ROOT" \ + --set "*.ssh=default" \ + --set "*.platform=$platform" \ + --set "*.args.ROS_DISTRO=$rosdistro" \ + --set "*.args.BASE_IMAGE=$base_image" \ + --set "*.args.AUTOWARE_BASE_IMAGE=$autoware_base_image" \ + --set "*.args.AUTOWARE_BASE_CUDA_IMAGE=$autoware_base_cuda_image" \ + --set "*.args.SETUP_ARGS=$setup_args" \ + --set "*.args.LIB_DIR=$lib_dir" \ + --set "universe-devel.tags=ghcr.io/autowarefoundation/autoware:universe-devel" \ + --set "universe-devel-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-devel-cuda" \ + --set "universe.tags=ghcr.io/autowarefoundation/autoware:universe" \ + --set "universe-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-cuda" \ + "$target$image_name_suffix" set +x }