Skip to content

Commit

Permalink
fix description of detector docker.sh and simplify commands
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswittich committed Oct 24, 2023
1 parent df7ff1d commit 863abe4
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions detector/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@ if [ $# -eq 0 ]
then
echo "Usage:"
echo
echo " `basename $0` (b | build) [<containers>] Build or rebuild"
echo " `basename $0` (U | update) [<containers>] download latest images"
echo " `basename $0` (d | down) [<containers>] Stop and remove"
echo " `basename $0` (r | run) [<containers>] Run"
echo " `basename $0` (s | stop) [<containers>] Stop (halt)"
echo " `basename $0` (k | kill) [<containers>] Kill"
echo " `basename $0` ps [<containers>] List"
echo " `basename $0` rm [<containers>] Remove"
echo " `basename $0` stats Show statistics"
echo " `basename $0` (b | build) [<containers>] Build or rebuild"
echo " `basename $0` (bnc) [<containers>] Build or rebuild without using cache"
echo " `basename $0` (d | debug) [<containers>] Stop and remove"
echo " `basename $0` (p | push) [<containers>] Push images"
echo " `basename $0` (r | run) [<containers>] Run"
echo " `basename $0` (ri | run-image)[<containers>] Run image (no dev)"
echo " `basename $0` (s | stop) [<containers>] Stop"
echo " `basename $0` (U | update) [<containers>] Download latest images"
echo " `basename $0` (k | kill) [<containers>] Kill"
echo " `basename $0` ps [<containers>] List"
echo " `basename $0` rm [<containers>] Kill and remove"
echo " `basename $0` stats Show statistics"
echo
echo " `basename $0` (l | log) <container> Show log tail (last 100 lines)"
echo " `basename $0` (e | exec) <container> <command> Execute command"
echo " `basename $0` (a | attach) <container> Attach to container with shell"
echo
echo " `basename $0` prune Remove all unused containers, networks and images"
echo " `basename $0` stopall Stop all running containers (system-wide!)"
echo " `basename $0` killall Kill all running containers (system-wide!)"
echo
echo "Arguments:"
echo
echo " containers One or more containers (omit to affect all containers)"
Expand Down Expand Up @@ -57,17 +56,13 @@ fi

# Check if we are on a Jetson device
build_args=""
if [ -f /etc/nv_tegra_release ]; then
build_args+=" --build-arg BASE_IMAGE=zauberzeug/l4t-opencv:4.5.2-on-nano-r$L4T_VERSION"
else
build_args+=" --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:23.07-py3" # this is python 3.10
fi

if [ -f /etc/nv_tegra_release ]
if [ -f /etc/nv_tegra_release ];
then
build_args+=" --build-arg BASE_IMAGE=zauberzeug/l4t-opencv:4.5.2-on-nano-r$L4T_VERSION"
image="zauberzeug/yolov5-detector:$L4T_VERSION"
dockerfile="jetson.dockerfile"
else
build_args+=" --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:23.07-py3" # this is python 3.10
image="zauberzeug/yolov5-detector:cloud"
dockerfile="cloud.dockerfile"
fi
Expand All @@ -84,30 +79,30 @@ case $cmd in
docker build --no-cache . -f $dockerfile --target release -t $image $build_args $cmd_args
docker build . -f $dockerfile -t ${image}-dev $build_args $cmd_args
;;
d | debug)
docker run $run_args $image-dev /app/start.sh debug
;;
U | update)
docker pull ${image}
docker pull ${image}-dev
;;
d | debug)
docker run $run_args $image-dev /app/start.sh debug
p | push)
docker push ${image}-dev
docker push $image
;;
r | run)
docker run $run_args $image-dev $cmd_args
;;
ri | run-image)
docker run $run_args $image $cmd_args
;;
p | push)
docker push ${image}-dev
docker push $image
;;
s | stop)
docker stop $name $cmd_args
;;
k | kill)
docker kill $name $cmd_args
;;
d | rm)
rm)
docker kill $name
docker rm $name $cmd_args
;;
Expand Down

0 comments on commit 863abe4

Please sign in to comment.