Use Docker packaged mirror on Ubuntu

This will start about a bit ignorant, straightforward point is that the code under the local path into the docker to go inside, and then run a program we call docker in this isolated environment. Please explain to retrieve their own professional learning.

 

Step 1: Create a container

docker run --gpus all -it -v  /data/Ariel:/model xlnet/cls:20190902 /bin/bash

 

There are two parts color can be modified according to the actual situation, this step is executed, it will generate a container id, create a mirror behind the second step you need to use this container id.

/ data / Ariel local code path, beyond which the function code need to use, also include model_server.py, .thrift documents, as well as trained weights file (checkpoints on the inside). Which model_server.py, .thrift file is out of their own targeted according to the code writing and requires the successful operation model_server.py (it is equivalent to a test script, the script runs successfully without this test bug, we can use the code behind file) before packing your own image.

/ model of our own native code mapped to the storage path docker in, that is what the local path there, what docker in the model should have.

xlnet / cls: 20190902 old mirror image of their own to use. So, after the first step to create the container, the contents of the new model contained inside the container is in fact the original mirror inside, his new series of data mapped in the data directory docker, if the model is not empty, you need to delete the data model, own data into the model are ok.

 

 

Step 2: Create a new image

You need to perform this step to exit the vessel.

docker commit -m'xlnet/cls' -a'ariel' ******* xlnet/cls:20200902

 

******* asterisk after the first step is to create a container after generation of container id.

ok, exit the container, use the command docker images look mirrored his own newly created.

Guess you like

Origin www.cnblogs.com/ariel-dreamland/p/11457741.html