The conversion docker image's Dockerfile
corresponds to docker-images/Dockerfile/convert/ubuntu1604/Dockerfile.*
.
There are currently two Dockerfile
based on ubuntu1604
, the differences of which are described later.
- Install
Docker
The following
Dockerfile
can be built successfully onDocker
version20.10.7
- High-quality network
Dockerfile.all
containsPython3.5 3.6 3.7 3.8 Python2.7
, wherePython3
is managed usingupdate-alternatives
andPython3.6 3.7 3.8
requires installingpip
manually .Use
update-alternatives --config python3
to switch between versions
After successful switch, usecurl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py
to installpip
Dockerfile.select
containsPython2.7 Python3.7 Python3.5
by default, wherePython3.7
can be replaced byPython3.6 Python3.8
at the build stage of the image, and the user does not need to installpip
.
- If you choose
Dockerfile.select
to build the image, you need to specify thePython3
version with thePYTHON_VERSION
parameter, otherwisePython3.7
will be installed by default.docker build -t bmnnsdk2-bm1684/dev:ubuntu1604 -f Dockerfile.select --build-arg PYTHON_VERSION=3.x
3.x
can be replaced with3.6 3.7 3.8
- If the user chooses
Dockerfile.all
for image buildingdocker build -t bmnnsdk2-bm1684/dev:ubuntu1604 -f Dockerfile.all
Note that using thisDockerfile
will multiple times compile thePython
source code, so please be patient.
Please use it with the SDK
, see the tutorial on the official website for details.
The deployment image's Dockerfile
corresponds to docker-images/Dockerfile/deploy/x86/ubuntu1604/Dockerfile/*
.
- Install
Docker
The following
Dockerfile
can be built successfully onDocker
version20.10.7
- High-quality network
- If you choose
Dockerfile.select
to build the image, you need to specify thePython3
version with thePYTHON_VERSION
parameter, otherwisePython3.7
will be installed by default.docker build -t bmnnsdk2-bm1684/product:ubuntu1604 -f Dockerfile.select --build-arg PYTHON_VERSION=3.x
3.x
can be replaced with3.6 3.7 3.8
- If the user chooses
Dockerfile.all
for image buildingdocker build -t bmnnsdk2-bm1684/product:ubuntu1604 -f Dockerfile.all
Note that using thisDockerfile
will multiple times compile thePython
source code, so please be patient.
- Go to the
SDK
root directory. - Create the script file
start_docker.sh
, the content of which is referenced below and can be adapted to suit your needs.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKSPACE=$PWD
if [ -c "/dev/bm-sophon0" ]; then
for dev in $(ls /dev/bm-sophon*);
do
mount_options+="--device="$dev:$dev" "
done
fi
docker run \
--workdir=/workspace \
--privileged=true \
${mount_options} \
--device=/dev/bmdev-ctl:/dev/bmdev-ctl \
-v /dev/shm --tmpfs /dev/shm:exec \
-v $WORKSPACE:/workspace \
-v /dev:/dev \
-v /etc/localtime:/etc/localtime \
-e LOCAL_USER_ID=`id -u` \
-it bmnnsdk2-bm1684/product:ubuntu1604 \
bash
-
Run the script to start
Docker
-
cd scripts && ./install_lib.sh nntc && source ./envsetup_pcie.sh