Failed to build base image: isaac_ros_dev-x86_64, aborting

Hi,

I’m trying to execute the ./scripts/run_dev.sh from this tutorial:

Step 3>
https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_pose_estimation/isaac_ros_dope/index.html#quickstart

Here is what i get from the command “bash -xv scripts/run_dev.sh”

#!/bin/bash
#
# Copyright (c) 2021-2022, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+++ dirname scripts/run_dev.sh
++ cd scripts
++ pwd
+ ROOT=/home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts
source $ROOT/utils/print_color.sh
+ source /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/utils/print_color.sh
#!/bin/bash -e
#
# Copyright (c) 2021, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

function print_color {
    tput setaf $1
    echo "$2"
    tput sgr0
}

function print_error {
    print_color 1 "$1"
}

function print_warning {
    print_color 3 "$1"
}

function print_info {
    print_color 2 "$1"
}

function usage() {
    print_info "Usage: run_dev.sh" {isaac_ros_dev directory path OPTIONAL}
    print_info "Copyright (c) 2021-2022, NVIDIA CORPORATION."
}

# Read and parse config file if exists
#
# CONFIG_IMAGE_KEY (string, can be empty)

if [[ -f "${ROOT}/.isaac_ros_common-config" ]]; then
    . "${ROOT}/.isaac_ros_common-config"
fi
+ [[ -f /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/.isaac_ros_common-config ]]

ISAAC_ROS_DEV_DIR="$1"
+ ISAAC_ROS_DEV_DIR=
if [[ -z "$ISAAC_ROS_DEV_DIR" ]]; then
    ISAAC_ROS_DEV_DIR_DEFAULTS=("$HOME/workspaces/isaac_ros-dev" "/workspaces/isaac_ros-dev")
    for ISAAC_ROS_DEV_DIR in "${ISAAC_ROS_DEV_DIR_DEFAULTS[@]}"
    do
        if [[ -d "$ISAAC_ROS_DEV_DIR" ]]; then
            break
        fi
    done

    if [[ ! -d "$ISAAC_ROS_DEV_DIR" ]]; then
        ISAAC_ROS_DEV_DIR=$(realpath "$ROOT/../")
    fi
    print_warning "isaac_ros_dev not specified, assuming $ISAAC_ROS_DEV_DIR"
else
    if [[ ! -d "$ISAAC_ROS_DEV_DIR" ]]; then
        print_error "Specified isaac_ros_dev does not exist: $ISAAC_ROS_DEV_DIR"
        exit 1
    fi
    shift 1
fi
+ [[ -z '' ]]
+ ISAAC_ROS_DEV_DIR_DEFAULTS=("$HOME/workspaces/isaac_ros-dev" "/workspaces/isaac_ros-dev")
+ for ISAAC_ROS_DEV_DIR in "${ISAAC_ROS_DEV_DIR_DEFAULTS[@]}"
+ [[ -d /home/coucou/workspaces/isaac_ros-dev ]]
+ break
+ [[ ! -d /home/coucou/workspaces/isaac_ros-dev ]]
+ print_warning 'isaac_ros_dev not specified, assuming /home/coucou/workspaces/isaac_ros-dev'
+ print_color 3 'isaac_ros_dev not specified, assuming /home/coucou/workspaces/isaac_ros-dev'
+ tput setaf 3
+ echo 'isaac_ros_dev not specified, assuming /home/coucou/workspaces/isaac_ros-dev'
isaac_ros_dev not specified, assuming /home/coucou/workspaces/isaac_ros-dev
+ tput sgr0

ON_EXIT=()
+ ON_EXIT=()
function cleanup {
    for command in "${ON_EXIT[@]}"
    do
        $command
    done
}
trap cleanup EXIT
+ trap cleanup EXIT

pushd . >/dev/null
+ pushd .
cd $ROOT
+ cd /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts
ON_EXIT+=("popd")
+ ON_EXIT+=("popd")

# Prevent running as root.
if [[ $(id -u) -eq 0 ]]; then
    print_error "This script cannot be executed with root privileges."
    print_error "Please re-run without sudo and follow instructions to configure docker for non-root user if needed."
    exit 1
fi
++ id -u
+ [[ 1000 -eq 0 ]]

# Check if user can run docker without root.
RE="\<docker\>"
+ RE='\<docker\>'
if [[ ! $(groups $USER) =~ $RE ]]; then
    print_error "User |$USER| is not a member of the 'docker' group and cannot run docker commands without sudo."
    print_error "Run 'sudo usermod -aG docker \$USER && newgrp docker' to add user to 'docker' group, then re-run this script."
    print_error "See: https://docs.docker.com/engine/install/linux-postinstall/"
    exit 1
fi
++ groups coucou
+ [[ ! coucou : coucou adm cdrom sudo dip plugdev lpadmin lxd sambashare docker =~ \<docker\> ]]

# Check if able to run docker commands.
if [[ -z "$(docker ps)" ]] ;  then
    print_error "Unable to run docker commands. If you have recently added |$USER| to 'docker' group, you may need to log out and log back in for it to take effect."
    print_error "Otherwise, please check your Docker installation."
    exit 1
fi
++ docker ps
+ [[ -z CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES ]]

# Check if git-lfs is installed.
git lfs &>/dev/null
+ git lfs
if [[ $? -ne 0 ]] ; then
    print_error "git-lfs is not insalled. Please make sure git-lfs is installed before you clone the repo."
    exit 1
fi
+ [[ 0 -ne 0 ]]

# Check if all LFS files are in place in the repository where this script is running from.
cd $ROOT
+ cd /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts
git rev-parse &>/dev/null
+ git rev-parse
if [[ $? -eq 0 ]]; then
    LFS_FILES_STATUS=$(cd $ISAAC_ROS_DEV_DIR && git lfs ls-files | cut -d ' ' -f2)
    for (( i=0; i<${#LFS_FILES_STATUS}; i++ )); do
        f="${LFS_FILES_STATUS:$i:1}"
        if [[ "$f" == "-" ]]; then
            print_error "LFS files are missing. Please re-clone the repo after installing git-lfs."
            exit 1
        fi
    done
fi
+ [[ 0 -eq 0 ]]
++ cd /home/coucou/workspaces/isaac_ros-dev
++ git lfs ls-files
++ cut -d ' ' -f2
+ LFS_FILES_STATUS=in
+ (( i=0 ))
+ (( i<2 ))
+ f=i
+ [[ i == \- ]]
+ (( i++  ))
+ (( i<2 ))
+ f=n
+ [[ n == \- ]]
+ (( i++  ))
+ (( i<2 ))

PLATFORM="$(uname -m)"
++ uname -m
+ PLATFORM=x86_64

BASE_NAME="isaac_ros_dev-$PLATFORM"
+ BASE_NAME=isaac_ros_dev-x86_64
CONTAINER_NAME="$BASE_NAME-container"
+ CONTAINER_NAME=isaac_ros_dev-x86_64-container

# Remove any exited containers.
if [ "$(docker ps -a --quiet --filter status=exited --filter name=$CONTAINER_NAME)" ]; then
    docker rm $CONTAINER_NAME > /dev/null
fi
++ docker ps -a --quiet --filter status=exited --filter name=isaac_ros_dev-x86_64-container
+ '[' '' ']'

# Re-use existing container.
if [ "$(docker ps -a --quiet --filter status=running --filter name=$CONTAINER_NAME)" ]; then
    print_info "Attaching to running container: $CONTAINER_NAME"
    docker exec -i -t -u admin --workdir /workspaces/isaac_ros-dev $CONTAINER_NAME /bin/bash $@
    exit 0
fi
++ docker ps -a --quiet --filter status=running --filter name=isaac_ros_dev-x86_64-container
+ '[' '' ']'

# Build image
IMAGE_KEY=ros2_humble
+ IMAGE_KEY=ros2_humble
if [[ ! -z "${CONFIG_IMAGE_KEY}" ]]; then
    IMAGE_KEY=$CONFIG_IMAGE_KEY
fi
+ [[ ! -z '' ]]

BASE_IMAGE_KEY=$PLATFORM.user
+ BASE_IMAGE_KEY=x86_64.user
if [[ ! -z "${IMAGE_KEY}" ]]; then
    BASE_IMAGE_KEY=$PLATFORM.$IMAGE_KEY

    # If the configured key does not have .user, append it last
    if [[ $IMAGE_KEY != *".user"* ]]; then
        BASE_IMAGE_KEY=$BASE_IMAGE_KEY.user
    fi
fi
+ [[ ! -z ros2_humble ]]
+ BASE_IMAGE_KEY=x86_64.ros2_humble
+ [[ ros2_humble != *\.\u\s\e\r* ]]
+ BASE_IMAGE_KEY=x86_64.ros2_humble.user

print_info "Building $BASE_IMAGE_KEY base as image: $BASE_NAME using key $BASE_IMAGE_KEY"
+ print_info 'Building x86_64.ros2_humble.user base as image: isaac_ros_dev-x86_64 using key x86_64.ros2_humble.user'
+ print_color 2 'Building x86_64.ros2_humble.user base as image: isaac_ros_dev-x86_64 using key x86_64.ros2_humble.user'
+ tput setaf 2
+ echo 'Building x86_64.ros2_humble.user base as image: isaac_ros_dev-x86_64 using key x86_64.ros2_humble.user'
Building x86_64.ros2_humble.user base as image: isaac_ros_dev-x86_64 using key x86_64.ros2_humble.user
+ tput sgr0
$ROOT/build_base_image.sh $BASE_IMAGE_KEY $BASE_NAME '' '' ''
+ /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/build_base_image.sh x86_64.ros2_humble.user isaac_ros_dev-x86_64 '' '' ''
Using base image name not specified, using ''
Using docker context dir not specified, using Dockerfile directory
Resolved the following Dockerfiles for target image: x86_64.ros2_humble.user
/home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/../docker/Dockerfile.user
/home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/../docker/Dockerfile.x86_64.ros2_humble
Building /home/coucou/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/../docker/Dockerfile.x86_64.ros2_humble as image: x86_64-ros2_humble-image with base: 
ERROR: BuildKit is enabled but the buildx component is missing or broken.
       Install the buildx component to build images with BuildKit:
       https://docs.docker.com/go/buildx/

if [ $? -ne 0 ]; then
    print_error "Failed to build base image: $BASE_NAME, aborting."
    exit 1
fi
+ '[' 1 -ne 0 ']'
+ print_error 'Failed to build base image: isaac_ros_dev-x86_64, aborting.'
+ print_color 1 'Failed to build base image: isaac_ros_dev-x86_64, aborting.'
+ tput setaf 1
+ echo 'Failed to build base image: isaac_ros_dev-x86_64, aborting.'
Failed to build base image: isaac_ros_dev-x86_64, aborting.
+ tput sgr0
+ exit 1
cleanup
+ cleanup
+ for command in "${ON_EXIT[@]}"
+ popd
~/workspaces/isaac_ros-dev/src/isaac_ros_common

I saw there were a similar topic but not providing the solution…

BTW i’m on Ubuntu 22.04, ROS2 Humble

Installing docker-buildx solved the problem>

sudo apt install docker-buildx

1 Like