制作Dockerfile
Dockerfile
# base image from harbor
FROM 192.168.50.21/srp-dis-server/ubuntu:18.04_cuda10.2_cudnn7_devel
# author
ARG CODE_BRANCH
# add user
USER root
RUN rm -rf /home/geekplusa/ai/projects/simpleedu/docker/simpledl
COPY hack/requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
# install simpledl
RUN echo "\033[42;37m >>>>>>>>> Code Branch: $CODE_BRANCH \033[0m"
RUN git clone -b $CODE_BRANCH git@192.168.50.14:slab/simpledl.git /home/geekplusa/ai/projects/simpleedu/docker/simpledl
RUN chown -R simpleai:simpleai /home/geekplusa/ai/projects/simpleedu/docker/simpledl
# normal user configure
USER simpleai
打包
cd /kolla/dockerifle/slab_project_dockerfile/ubuntu18.04_paddle_simpledl_gpu/new/
docker build --build-arg CODE_BRANCH=develop -t 192.168.101.203:4000/slab-image/f78094c242c311eca012ac1f6ba11d0a:18.04_cuda10.2_cudnn7_v1.5 .
运行
docker run -it --entrypoint /bin/bash --privileged --cap-add SYS_ADMIN -p 16003:6003 -p 19999:9999 --device /dev/fuse 282a94ce0f31
echo "admin:admin123" > /home/simpleai/.admin-passwd-s3fs; chmod 600 /home/simpleai/.admin-passwd-s3fs
mkdir -p /home/simpleai/workspace/rodata/catvsdog
s3fs -f dmc:/images/catvsdog/ds_src /home/simpleai/workspace/rodata/catvsdog -o passwd_file=/home/simpleai/.admin-passwd-s3fs,use_path_request_style,uid=1000,gid=1000,url=http://192.168.101.203:9000 -o nonempty -o no_check_certificate&
chmod -R 644 /home/simpleai/workspace/rodata/catvsdog/*