2017년 7월 17일 월요일

[2017-07-17 월][ILKMOOC]도커 Image 생성

 박성남 재단 지원기관인 일크무크를 만들어가는 중입니다. 현재 물리학을 전공하고 있어 이쪽 지식이 많이 없습니다. 용어의 잘못된 사용이 많을테니 주의 하시기 바랍니다.





 Docker 명령어는 다음과 같은 형태를 가지고 있습니다. Docker의 가능한 subcommands 들을 보려면 "$ docker"라고 쓰시면 됩니다.



1
$ docker [option] [command] [arguments]
cs

도커 설치를 한후 아래 명령어를 실행하면,

1
$ docker run hello-world
cs



다음과 같은 문구가 뜰 것입니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
cs



Ubuntu image type을 검색한 후에 pull 명령어를 통해 다운로드를 합니다.

1
$ docker search ubuntu:16.04
cs
1
$ docker pull ubuntu
cs

run 명령어를 통해 container를 실행한 후 images를 통해 동작하는 container들을 확인합니다.

1
2
3
4
5
6
7
$ docker run ubuntu
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              16.04               d355ed3537e9        3 weeks ago         119MB
hello-world         latest              1815c82652c0        4 weeks ago         1.84kB
cs


컨테이너 접속

1
$ docker run -it ubuntu:16.04
cs
1
2
Output
root@d9b100f2f636:/#
cs

컨테이너에서 나오기


댓글 없음:

댓글 쓰기