02.Docker/Docker

자주 사용하는 Docker 명령어

basicinfo119 2022. 3. 18. 19:43
728x90
반응형

자주사용하는 도커 명령어에 대해 정리해 보았습니다. 

 

Docker Volume 명령어

docker volume create test-volume 

docker volume ls

docker volume inspect test-volume

docker volume rm test-volume

 

docker volume 생성 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume create test-volume
test-volume

 

docker volume list 확인 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume ls
DRIVER    VOLUME NAME
local     compose_config_files
local     compose_db
local     compose_django
local     django-on-docker_media_volume
local     django-on-docker_postgres_data
local     django-on-docker_static_volume
local     oracle-docker_oradata
local     qms-on-docker_media_volume
local     qms-on-docker_postgres_data
local     qms-on-docker_static_volume
local     test-volume

 

docker volume 정보 확인 

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume inspect test-volume
[
    {
        "CreatedAt": "2022-03-18T19:29:25+09:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/data300G/docker-image/volumes/test-volume/_data",
        "Name": "test-volume",
        "Options": {},
        "Scope": "local"
    }
]

 

docker volume 삭제

[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume rm test-volume
test-volume
[oracle-docker@minsvr:/data1/oracle-docker/oradata]$ docker volume ls
DRIVER    VOLUME NAME
local     compose_config_files
local     compose_db
local     compose_django
local     django-on-docker_media_volume
local     django-on-docker_postgres_data
local     django-on-docker_static_volume
local     oracle-docker_oradata
local     qms-on-docker_media_volume
local     qms-on-docker_postgres_data
local     qms-on-docker_static_volume

 

Docker 컨테이너 모두 중지 및 삭제

 docker stop $(docker ps -a -q)
 docker rm $(docker ps -a -q)

 

$ docker ps -a 
CONTAINER ID   IMAGE                       COMMAND                  CREATED        STATUS                    PORTS                                                                                  NAMES
9cffbff6ec74   oracle/database:19.3.0-ee   "/bin/sh -c 'exec $O   24 hours ago   Up 49 minutes (healthy)   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 0.0.0.0:5500->5500/tcp, :::5500->5500/tcp   ora19c

$ docker ps -a -q
9cffbff6ec74

Docker Image 모두 삭제

docker rmi $(docker images -q)

Docker Image 리스트 확인

[oracle-docker@minsvr:/data1/oracle-docker]$ docker image ls 
REPOSITORY                           TAG                   IMAGE ID       CREATED          SIZE
192.168.17.83:5000/oracle/database   19.3.0-ee_v2          7a2299cca529   46 minutes ago   6.97GB
oracle/database                      19.3.0-ee             a5a30da1721d   3 weeks ago      6.54GB
oraclelinux                          7-slim                4133e87bc7fa   2 months ago     132MB
apache/ozone-runner                  20200625-1            f6874ac36a4c   21 months ago    1.07GB
tomcat                               8.5.46-jdk8-openjdk   8973f493aa0a   2 years ago      508MB
[oracle-docker@minsvr:/data1/oracle-docker]$ docker images -q
7a2299cca529
a5a30da1721d
4133e87bc7fa
f6874ac36a4c
8973f493aa0a
728x90
반응형