-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
Chieh-Yu Lee edited this page Jun 14, 2022
·
24 revisions
Steps:
- stop the running docker container
docker container stop digital-sorter - remove the docker container
docker container rm digital-sorter - remove the current image
docker image rm digital-sorter - rebuild the image (with different port, stated in Dockerfile)
docker build -t digital-sorter . - docker run it with 9001:3939 port mapping (digital-sorter) 9003:4141 (private-sorter)
docker save --output digital-sorter03.tar digital-sorter
After transferring the .tar file to another server, use docker load -i digital-sorter03.tar to load the latest image
Mount folders (data and www). data is a folder with datasets. www is a folder with PNGs.
docker run -p 9001:3939 -d \
--mount type=bind,source=/mnt/P01.digital_sorter/digital_sorter/data,target=/app/data \ #mount data folder
--mount type=bind,source=/mnt/P01.digital_sorter/digital_sorter/www,target=/app/www \ #mount www folder (for pictures)
-it \
--name digital-sorter \
digital-sorter
docker run -p 9003:4141 -d \
--mount type=bind,source=/mnt/P01.digital_sorter/private_sorter/data,target=/app/data \
--mount type=bind,source=/mnt/P01.digital_sorter/private_sorter/www,target=/app/www \
-it \
--name private-sorter \
private-sorter