docker commit [컨테이너 ID] [원하는 이미지명:태그]
root@coforward:/home/coforward# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0b508f68aea2 ubuntu "/bin/bash" 4 hours ago Exited (137) 2 hours ago youthful_tharp
root@coforward:/home/coforward# docker commit 0b508f68aea2 ubuntu:0.90
sha256:15486c756a163ed7e78e7a7750a1e1843be634b9af6e826a3993505b23f9e3ac
root@coforward:/home/coforward# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 0.90 15486c756a16 9 seconds ago 286MB
ubuntu latest 5a81c4b8502e 5 weeks ago 77.8MB
docker run -it -d --privileged=true --name [NAMES] [PORTS] [IMAGE] /sbin/init
[root@localhost src]# docker run -it -d --privileged=true --name gama_0.92 -p 9047:9047/udp -p 8000:80 -p 8021:21 -p 8022:21 -p 33306:3306 -p 9999:9999 -p 8081:8080 gama_ubuntu0.92 /sbin/init
b1d04f563d7b9986290bbcc8e37c03319ef6876fa409def351bcf2b88d95d6f7
[root@localhost src]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b1d04f563d7b gama_ubuntu0.92 "/sbin/init" 11 seconds ago Up 8 seconds 0.0.0.0:9047->9047/udp, :::9047->9047/udp, 9991-9993/tcp, 0.0.0.0:9999->9999/tcp, :::9999->9999/tcp, 0.0.0.0:8021->21/tcp, 0.0.0.0:8022->21/tcp, :::8021->21/tcp, :::8022->21/tcp, 0.0.0.0:8000->80/tcp, :::8000->80/tcp, 0.0.0.0:33306->3306/tcp, :::33306->3306/tcp, 0.0.0.0:8081->8080/tcp, :::8081->8080/tcp gama_0.92
d866515e3d06 gama_ubuntu0.91 "/sbin/init" 4 weeks ago Exited (137) 3 minutes ago
'Docker' 카테고리의 다른 글
docker image를 tar 파일 save / load(화일 다운로드) (0) | 2023.10.05 |
---|---|
Docker 이미지 삭제 (0) | 2023.08.07 |
Docker Pull을 이용해 도커 이미지 갖고 오기 (0) | 2023.08.07 |
Docker 사용법 (0) | 2021.11.04 |