도커 입문(docker introduction)

2021. 4. 13. 21:17Docker

728x90
반응형

먼저 윈도우, 맥, 리눅스에 도커를 설치 해야한다.

 

search 명령으로 이미지 검색하기


 cmd 창에 docker search [찾고싶은것] 

> docker search centos
NAME                               DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
centos                             The official build of CentOS.                   6511      [OK]
ansible/centos7-ansible            Ansible on Centos7                              133                  [OK]
consol/centos-xfce-vnc             Centos container with "headless" VNC session…   128                  [OK]
jdeathe/centos-ssh                 OpenSSH / Supervisor / EPEL/IUS/SCL Repos - …   117                  [OK]
centos/systemd                     systemd enabled base container.                 97                   [OK]
imagine10255/centos6-lnmp-php56    centos6-lnmp-php56                              58                   [OK]
tutum/centos                       Simple CentOS docker image with SSH access      47
kinogmt/centos-ssh                 CentOS with SSH                                 29                   [OK]
pivotaldata/centos-gpdb-dev        CentOS image for GPDB development. Tag names…   13
guyton/centos6                     From official centos6 container with full up…   10                   [OK]
centos/tools                       Docker image that has systems administration…   7                    [OK]
drecom/centos-ruby                 centos ruby                                     6                    [OK]
pivotaldata/centos                 Base centos, freshened up a little with a Do…   5
pivotaldata/centos-gcc-toolchain   CentOS with a toolchain, but unaffiliated wi…   3
pivotaldata/centos-mingw           Using the mingw toolchain to cross-compile t…   3
darksheer/centos                   Base Centos Image -- Updated hourly             3                    [OK]
mamohr/centos-java                 Oracle Java 8 Docker image based on Centos 7    3                    [OK]
miko2u/centos6                     CentOS6 日本語環境                               2                    [OK]
indigo/centos-maven                Vanilla CentOS 7 with Oracle Java Developmen…   2                    [OK]
amd64/centos                       The official build of CentOS.                   2
blacklabelops/centos               CentOS Base Image! Built and Updates Daily!     1                    [OK]
mcnaughton/centos-base             centos base image                               1                    [OK]
pivotaldata/centos6.8-dev          CentosOS 6.8 image for GPDB development         0
smartentry/centos                  centos with smartentry                          0                    [OK]
pivotaldata/centos7-dev            CentosOS 7 image for GPDB development           0

 

pull 명령으로 이미지 받기


cmd 창에 docker pull [가져올 이미지]

docker pull [이미지 이름]:[태그] 태그에 latest를 설정하면 최신 버전을 받는다

>docker pull centos
Using default tag: latest
latest: Pulling from library/centos
7a0437f04f83: Pull complete
Digest: sha256:5528e8b1b1719d34604c87e11dcd1c0a20bedf46e83b5632cdeac91b8c04efc1
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest

 

images 명령으로 이미지 목록 출력하기


 cmd 창에 docker images

>docker images
REPOSITORY                           TAG                                                     IMAGE ID       CREATED         SIZE
centos                               latest                                                  300e315adb2f   4 months ago    209MB

 

 

도커 허브(Docker Hub) - 공식 이미지 레지스트리


 

이미지와 관련된 정보 도커 허브에서 확인할 수 있다.

hub.docker.com/

 

Docker Hub

We and third parties use cookies or similar technologies ("Cookies") as described below to collect and process personal data, such as your IP address or browser information. You can learn more about how this site uses Cookies by reading our privacy policy

hub.docker.com

아래는 CentOS 이미지에 관한 내용을 알수 있다.

index.docker.io/_/centos/

 

centos - Docker Hub

Supported tags and respective Dockerfile links latest, centos8, 8 centos7, 7 centos6, 6 centos7.7.1908, 7.7.1908 centos7.6.1810, 7.6.1810 centos7.5.1804, 7.5.1804 centos7.4.1708, 7.4.1708 centos7.3.1611, 7.3.1611 centos7.2.1511, 7.2.1511 centos7.1.1503, 7.

index.docker.io

 

 

run 명령으로 컨테이너 생성하기


docker run [옵션] [이미지 이름] [실행할 파일]

  • -i(interactive), -t(Pseudo-tty) 옵션을 사용하면 실행된 Bash 셸에 입력 및 출력을 할 수 있다.
  • --name 옵션은 컨테이너의 이름을 지정할 수 있다. 이름을 지정하지 않으면 Docker가 자동으로 이름을 생성한다

cmd 창에 docker run -it centos

>docker run -it centos
[root@11ab1da951e5 /]#

바로 복잡한 설치과정 없이 CentOS 리눅스가 실행된다

반응형