Skip to content

Commit

Permalink
adjust variables for new build based on tensorrt container
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasNeugebauer committed Jan 10, 2024
1 parent dfee574 commit 713ae9d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions detector/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ if [ "$LINKLL" == "TRUE" ]; then
fi
fi

RUN mkdir -p $HOME/$DETECTOR_NAME/data

# Check if we are on a Jetson device
build_args=""
if [ -f /etc/nv_tegra_release ]
Expand All @@ -67,7 +65,12 @@ then
L4T_RELEASE=$(echo $L4T_VERSION_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
L4T_REVISION=$(echo $L4T_VERSION_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
build_args+=" --build-arg BASE_IMAGE=zauberzeug/l4t-opencv:4.5.2-on-nano-r$L4T_VERSION" # this is python 3.6
--build-arg
OPENCV_VERSION=4.6.0
MAKEFLAGS=-j6
build_args+=" --build-arg BASE_IMAGE=zauberzeug/l4t-python38-pytorch-trt:$L4T_VERSION" # this is python 3.8
# build_args+=" --build-arg JETSON_BASE=nvcr.io/nvidia/l4t-base:r$L4T_VERSION"
build_args+=" --build-arg MAKEFLAGS=$MAKEFLAGS --build-arg OPENCV_VERSION=$OPENCV_VERSION"
image="zauberzeug/yolov5-detector:nlv0.8.4-$L4T_VERSION"
dockerfile="jetson.dockerfile"
else
Expand All @@ -76,13 +79,14 @@ else
dockerfile="cloud.dockerfile"
fi


cmd=$1
cmd_args=${@:2}
set -x
case $cmd in
b | build)
docker build . -f $dockerfile --target release -t $image $build_args $cmd_args
docker build . -f $dockerfile -t ${image}-dev $build_args $cmd_args
DOCKER_BUILDKIT=0 docker build . -f $dockerfile --target release -t $image $build_args $cmd_args
DOCKER_BUILDKIT=0 docker build . -f $dockerfile -t ${image}-dev $build_args $cmd_args
;;
bnc | build-no-cache)
docker build --no-cache . -f $dockerfile --target release -t $image $build_args $cmd_args
Expand Down

0 comments on commit 713ae9d

Please sign in to comment.