Docker¶
DRLTT uses docker for SDK compiling, CI/CD, and more.
Currently supported docker images and their hierarchical relationship:
`drltt`
├── `drltt:cicd` # Docker image for setting up CI/CD
└── `drltt:runtime` # Docker image for run DRLTT, i.e. training/testing/sdk compilation/etc.
drltt:cicd: Build DRLTT CI/CD Docker Image¶
docker image build --tag drltt:cicd - < ./Dockerfile.cicd
drltt:runtime: Build DRLTT Runtime Docker Image¶
docker image build --tag drltt:runtime - < ./Dockerfile.runtime
Useful Tips¶
Tips 1: Networking Issue¶
For network environments within Mainland China, you may consider using a domestic pip source to accelerate this process and setting the timeout to a larger value:
docker image build --tag drltt:runtime --build-arg PIP_ARG=" -i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 1000 " - < ./Dockerfile.runtime
For APT source, you may consider using a domestic apt source to accelerate this process by appending the following part to the ./Dockerfile:
# Example using TUNA apt source
ARG APT_SOURCE_LIST=/etc/apt/sources.list
RUN \
mv ${APT_SOURCE_LIST} ${APT_SOURCE_LIST}.bak && \
touch ${APT_SOURCE_LIST} && \
printf "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse" >> ${APT_SOURCE_LIST} && \
printf "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse" >> ${APT_SOURCE_LIST} && \
printf "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse" >> ${APT_SOURCE_LIST} && \
printf "deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" >> ${APT_SOURCE_LIST} && \
cat ${APT_SOURCE_LIST}
Tip 2: Transferring Docker images¶
To save time by transferring the Docker images, save with the command:
docker image save drltt:runtime -o ./drltt.runtime.image
, and load with the command:
docker image load -i ./drltt.runtime.image
Tip 3: Clearing Cache¶
Tip: To remove unused images/cached, run:
docker system prune