-
Notifications
You must be signed in to change notification settings - Fork 3k
/
build.sh
executable file
·42 lines (33 loc) · 1.18 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# This script builds the jetson-inference docker container from source.
# It should be run from the root dir of the jetson-inference project:
#
# $ cd /path/to/your/jetson-inference
# $ docker/build.sh
#
# Also you should set your docker default-runtime to nvidia:
# https://github.com/dusty-nv/jetson-containers#docker-default-runtime
#
# find L4T_VERSION
source tools/l4t-version.sh
if [ $L4T_VERSION = "32.4.3" ]; then
BASE_IMAGE="nvcr.io/nvidia/l4t-pytorch:r32.4.3-pth1.6-py3"
elif [ $L4T_VERSION = "32.4.2" ]; then
BASE_IMAGE="nvcr.io/nvidia/l4t-pytorch:r32.4.2-pth1.5-py3"
else
echo "cannot build jetson-inference docker container"
echo "unsupported L4T version: R$L4T_VERSION"
exit 1
fi
echo "BASE_IMAGE=$BASE_IMAGE"
echo "TAG=jetson-inference:r$L4T_VERSION"
# sanitize workspace (so extra files aren't added to the container)
rm -rf python/training/classification/data/*
rm -rf python/training/classification/models/*
rm -rf python/training/detection/ssd/data/*
rm -rf python/training/detection/ssd/models/*
# build the container
sudo docker build -t jetson-inference:r$L4T_VERSION -f Dockerfile \
--build-arg BASE_IMAGE=$BASE_IMAGE \
.