Docker 사용법
1) Image list 확인
docker images -a
(base) donghwa@dh-server:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
fashion latest 23f3f15cb75e 7 weeks ago 7.4GB
2) container 확인
docker ps -a
(base) donghwa@dh-server:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c27fb22dc3ba fashion:latest "/bin/bash" 7 weeks ago Up 5 weeks 0.0.0.0:6006->6006/tcp, 0.0.0.0:8282->8282/tcp fashion
3) Container build
-it
: runing docker--shm-size
: shared memory-p
: port {host}:{docker}-v
: shared folder {host}:{docker}--name
: container namefashion:latest
: used imagedocker run -it -p 8282:8282 --shm-size=8gb --env="DISPLAY" -v /home/korea/fashion-recommendation/dataset/:/home/appuser/fashion_repo/dataset -v /home/korea/fashion-recommendation/model:/home/appuser/fashion_repo/model -v /home/korea/fashion-recommendation/src:/home/appuser/fashion_repo/src -v /home/korea/fashion-recommendation/script:/home/appuser/fashion_repo/script --name=seg_rec fashion:latest
4) Image 제거
docker rmi {image id}
5) Container 제거
docker rm ${container id}
6) Docker stop
sudo container kill {id}
7) Docker start
sudo docker start {id}
8) Docker runing
sudo docker exec -it {c_id} /bin/bash
9) File copy from/to Docker
docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt
docker cp kfashion_wok_history_json_1012.zip 063873750cf0:/home/appuser/detectron2_repo/data