[Docker] Docker Commands

Docker Commands

도커의 명령어 모음

Basic Commands Sytax

docker <option> <command> <ARG...>

Table of Contents

링크를 클릭하여 이동
| attach | build | commit | cp | create | diff | events | exec | export | history | images | import | info | inpect | kill | load | login | logout | logs | pause | port | ps | pull | push | rename | restart | rm | rmi | run | save | search | start | stats | stop | tag | top | unpause | update | version | wait |

A

attach

Attach local standard input, output, and error streams to a running container.
실행되고 있는 컨테이너에 입력(stdin)과 출력(stdout)을 연결하는 명령어.

↑ return to TOC

B

build

Build an image from a Dockerfile
Dockerfile로 image를 생성하는 명령어.

↑ return to TOC

C

commit

Create a new image from a container’s changes.
컨테이너의 변경 사항을 이미지로 생성하는 명령어.

cp

Copy files/folders between a container and the local filesystem.
컨테이너의 Directory/files을 host로 복사하는 명령어.

create

Create a new container.
Image로 컨테이너를 생성하는 명령어.

↑ return to TOC

D

diff

Inspect changes to files or directories on a container’s filesystem.
컨테이너에서 변경된 file을 확인하는 명령어.

↑ return to TOC

E

events

Get real time events from the server.
Docker 서버에 일어난 event를 실시간으로 출력하는 명령어.

exec

Run a command in a running container.
외부에서 컨테이너 안의 명령을 실행하는 명령어.

export

Export a container’s filesystem as a tar archive.
컨태이너의 filesystem을 tar 파일로 저장하는 명령어.

↑ return to TOC

H

history

Show the history of an image.
Image의 history를 출력하는 명령어.

↑ return to TOC

I

images

List images.
Image의 목록을 출력하는 명령어.

import

Import the contents from a tarball to create a filesystem image.
tar file로 압축된 filesystem으로부터 image를 생성하는 명령어.

info

Display system-wide information.
시스템, Docker Container, Image rotn, setting 등의 info를 출력하는 명령어.

inspect

Return low-level information on Docker objects.
container, image의 세부 정보를 JSON 형태로 출력하는 명령어.

Inspect Volume

↑ return to TOC

K

kill

Kill one or more running containers.
컨테이너를 중지하는 명령어.

↑ return to TOC

L

load

Load an image from a tar archive or STDIN.
tar file로 image를 생성하는 명령어.

login

Log in to a Docker registry.
Docker 레지스트리에 로그인 하는 명령어.

logout

Log out from a Docker registry.
Docker 레지스트리에서 로그아웃 하는 명령어.

logs

Fetch the logs of a container.
컨테이너의 log를 출력하는 명령어.

↑ return to TOC

P

pause

Pause all processes within one or more containers.
컨테이너에서 실행되고 있는 모든 processes를 일시 정지하는 명령어.

port

List port mappings or a specific mapping for the container.
컨테이너에서 port가 열려 있는지 확인하는 명령어.

ps

PS : Process Status

List containers.
현재 실행중인 컨테이너의 목록을 출력하는 명령어.

pull

Pull an image or a repository from a registry.
Docker 레지스트리에서 image를 pull받는 명령어.

push

Push an image or a repository to a registry.
Docker 레지스트리에 image를 올리는 명령어.

↑ return to TOC

R

rename

Rename a container

restart

Restart one or more containers

rm

Remove one or more containers

rmi

Remove one or more images

run

Run a command in a new container

↑ return to TOC

S

save

Save one or more images to a tar archive (streamed to STDOUT by default)

Search the Docker Hub for images

start

Start one or more stopped containers

stats

Display a live stream of container(s) resource usage statistics

stop

Stop one or more running containers

↑ return to TOC

T

tag

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

top

Display the running processes of a container

↑ return to TOC

U

unpause

Unpause all processes within one or more containers

update

Update configuration of one or more containers

↑ return to TOC

V

version

Show the Docker version information
도커의 버전 정보를 출력하는 명령어.

Check docker-compose Version

Update docker-compose Version

pip 를 사용하여 최신 버전으로 업데이트 하는 법은 아래와 같다.

↑ return to TOC

W

wait

Block until one or more containers stop, then print their exit codes

↑ return to TOC