Docker run

Jmnote (토론 | 기여)님의 2018년 10월 29일 (월) 17:30 판 (→‎예시2)

1 개요

docker run
  • 새로운 컨테이너에서 명령 실행

2 문법

$ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

3 예시

root@default:~# docker run -i -t ubuntu:14.04
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
bae382666908: Pull complete 
f1ddd5e846a8: Pull complete 
90d12f864ab9: Pull complete 
a57ea72e3176: Pull complete 
783a14252520: Pull complete 
Digest: sha256:f6eed4def93a3b54da920737f0abf1a8cae2e480bb368280c898265fcaf910a3
Status: Downloaded newer image for ubuntu:14.04
root@0967afc19f46:/# hostname
0967afc19f46
root@0967afc19f46:/# exit
exit
root@default:~#

4 예시2

$ docker search redis
NAME                              DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
redis                             Redis is an open source key-value store that…   5960                [OK]
bitnami/redis                     Bitnami Redis Docker Image                      92                                      [OK]
sameersbn/redis                                                                   71                                      [OK]
grokzen/redis-cluster             Redis cluster 3.0, 3.2, 4.0 & 5.0               38
... (생략)
xetamus/redis-resource            forked redis-resource                           0                                       [OK]
$ docker run -d redis
77f5be204ed82b399cefadc154b682dcffe61c3eb9ca118008eded4285ebbaeb
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
77f5be204ed8        redis               "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes        6379/tcp            adoring_curran

5 같이 보기

6 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}