Always with sudo
How to copy Docker images?
save:docker save -o <path for generated tar file> <image name>
load:docker load -i <path to image tar file>
e.g.docker save -o c:/myfile.tar centos:16
source: stackoverflow
How to run a bash in Docker?
docker run -it <image name> bash
How can I use the datasets in the host
In docker docs, there are three methods to mount.
First, I tried to create a new volume but I cannot read the dictionary because I was Permission denied
.
Second, I decided to create bind mounts
bydocker run <others> --mount type=bind, source=<the dir you want to mount>, target=<the dir in the container>, [readonly] <others>
.
Can I change the content in my image?
- Do something in a container created by your image.
- exit or ctrl+D
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Why cannot I use –mount?
Because of the version of your docker.
But you can use -v
instead of --mount
, the command in the official document is:
As a sample: docker run -it -v /home/songe/datasets:/opt/dataset dlib bash
.