Basic Docker Commands

docker 2021/04/19 22:14 용비
<get container image from docker hub>
docker pull {image_name}

<image list>
docker images

<container create>
docker run -i(interactive)t(pseudo-tty) -d(background) -p(hostport:containerport) hostport:containerport --name={name} image_name:tag

<container stop>
docker stop {name}
docker stop {container_id}

<container start>
docker start {name}
docker start {container_id}

<executing container process list>
docker ps

<total container list>
docker ps -a

<container connect>
docker exec -it {container_name} /bin/bash
: exec는 실행중인 컨테이너에 접속, run은 컨테이너를 신규로 생성하여 실행

<file share:host->container>
docker cp {host_file_path} {container_name}:{container_file_path}

<file share:container->host>
docker cp {container_name}:{container_file_path} {host_file_path}

<container remove>
docker rm {name}
docker rm {container_id}
docker rm {container_id}, {container_id}

<image remove>
docker rmi {image_id}

<container and image remove>
docker rmi -f {image_id}

받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://www.yongbi.net/rss/response/883

트랙백 주소 :: http://www.yongbi.net/trackback/883

트랙백 RSS :: http://www.yongbi.net/rss/trackback/883

댓글을 달아 주세요

댓글 RSS 주소 : http://www.yongbi.net/rss/comment/883
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다