View local mirror:
The relationship between containers and images: containers are objects, images are classes, and one image can have multiple containers.
docker commit container id new image name: version number
run container:
docker run -i -t ubuntu /bin/bash
docker exec -it -u root zwbase /bin/bash
docker exec -it will connect to the container. You can enter the container like SSH and perform operations. You can exit the container through exit without affecting the running of the container.
Anaconda environment activation/deactivation
source activate/deactivate
Package the container into an image:
Option function
-a Specify the new image author
-c Use Dockerfile Instructions to create the image
-m Submit the instructions for generating the image
-p Pause the container when committing
docker commit -a “tom” -m “create sanic img” ed54ac3a09ac sanic:v1
Package the image into a tar file:
docker cp NVIDIA-Linux-x86_64-535.54.03.run zwbase:/root
docker exec -it -u root zwbase /bin/bash