기타 docker - 4 컨테이너의 복제
페이지 정보

본문
컨테이너의 복제
기본준비
> docker pull ubuntu
> docker run -it --name my-ubuntu ubuntu /bin/bash
> docker start -i my-ubuntu /bin/bash : 해당 컨테이너의 재실행시
# apt update
# apt install vim
# apt install git
# apt install mc
도커이미지의 복제
> docker commit ubuntu ubuntu-git
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-git latest d6fffd94ba4a About a minute ago 314MB
httpd latest 96a2d0570deb 6 hours ago 168MB
ubuntu latest 5a81c4b8502e 4 weeks ago 77.8MB
> docker run -it --name 5nd ubuntu-git /bin/bash
# exit
> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8b9238012450 ubuntu-git "/bin/bash" About a minute ago Exited (129) 30 seconds ago 5nd
49df7f03edcc ubuntu "/bin/bash" 2 hours ago Exited (0) 2 minutes ago my-ubuntu
2b1d0316d642 httpd "httpd-foreground" 2 hours ago Exited (0) About an hour ago 4nd
20f1df9937a9 httpd "httpd-foreground" 2 hours ago Exited (0) About an hour ago 3rd
5906b43bcafb httpd "httpd-foreground" 2 hours ago Exited (0) About an hour ago 2nd
재실행시
> docker start -i 5nd
#
- 이전글docker - 리눅스컨테이너 : docker LXC LXD 관련 링크 23.08.03
- 다음글docker - 3 폴더 연결 23.08.01
댓글목록
등록된 댓글이 없습니다.