1.docker file
Dockerfile:
#FROM ubuntu:latest
FROM python:3.8
MAINTAINER <wangliyuan@datatang.com>
RUN sed -i s@/archive.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list
# 代码构建
COPY . /home/wenet
WORKDIR /home/wenet
#RUN apt-get update
#RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LANG zh_CN.utf8
RUN pip install -r requirements.txt \
&& pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
CMD /bin/bash
2.docker run
docker run -it --rm
-v /data/parallel-corpus-evaluator/new_data/:/home/test/new_data text_classifier_infer:2022_5_20
python predict.py
-input_file test_data1.txt
-output_file output2.txt
3.docker常用命令
(1)通过dockerfile创建镜像
docker build -t evaluate_classifier:test .
4.镜像出入
docker save -o images.tar postgres:9.6 mongo:3.4
docker load < hangge_server.tar