Server 관리를 위해 이것저것 보다가 발견한 Ansible,

그런데, Docker 관련하여 시스템 환경 셋팅을 할 일이 있어서 알아보다가 다시 만난 Ansible


생각보다 나온지는 꽤 된 놈이다. 무려.... 2012년...


아는 사람들은 꽤 오래전부터 사용해왔던듯.




Ubuntu에서 패키지로도 제공은 해주지만,

개인적인 취향으로 (그리고 폐쇄된 망을 사용해야하는 경우를 위해)

직접 Source를 내려받아서 package를 만들어서 설치하는 방법으로 알아보겠다.




1. 필요한 패키지들을 좀 설치해야 한다.


$ sudo apt-get install python-setuptools python-dev libffi-dev libssl-dev python-yaml python-paramiko python-jinja2 cdbs debhelper dpkg-dev reprepro asciidoc devscripts pbuilder sshpass




2. 소스코드는 GitHub로부터 다운로드를 받아야 한다. (당연히 git이 미리 설치되어 있어야 한다)


$ git clone git://github.com/ansible/ansible.git --recursive





3. dep 패키지를 만들어보자.



$ cd ./ansible


$ make deb-src


$ cd ./deb-build/unstable/ansible-2.4.0/


$ dpkg-buildpackage -us -uc -rfakeroot





4. 만들어 놓은 것을 이제 설치해보자.


$ cd ..


$ ls -al

합계 8072

drwxrwxr-x  3 u14 u14    4096  7월 16 20:15 ./

drwxrwxr-x  3 u14 u14    4096  7월 16 19:52 ../

drwxrwxr-x 11 u14 u14    4096  7월 16 20:14 ansible-2.4.0/

-rw-r--r--  1 u14 u14     792  7월 16 20:14 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable.dsc

-rw-rw-r--  1 u14 u14 5845022  7월 16 20:14 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable.tar.gz

-rw-r--r--  1 u14 u14 2387746  7월 16 20:15 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable_all.deb

-rw-rw-r--  1 u14 u14    1620  7월 16 20:15 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable_amd64.changes

-rw-r--r--  1 u14 u14    2375  7월 16 19:52 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable_source.build

-rw-r--r--  1 u14 u14    1240  7월 16 19:52 ansible_2.4.0-100.git201707151558.1a27546.devel~unstable_source.changes


$ sudo dpkg --install ./ansible_2.4.0-100.git201707151558.1a27546.devel~unstable_all.deb




5. 버전 확인하기


$ ansible --version

ansible 2.4.0

  config file = /etc/ansible/ansible.cfg

  configured module search path = [u'/home/u14/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /usr/lib/python2.7/dist-packages/ansible

  executable location = /usr/bin/ansible

  python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]



엄청 쉽다~!!!



반응형


DevOps 트렌드에 발맞추기 위해서 이런 저런 도구들을 찾아보면,

최근 가장 유명한 것은 Chef 아니면 Puppet 이라는 이름이 검색되곤 한다.


하지만, Ansible도 나름 유명한 도구라는...

그래서 계속 더 공부해보기로 했다.



1. hosts 파일

    - 앞에서는 임의의 위치에 hosts 파일을 만들어서 "-i" 옵션을 통해 직접 파일을 지정해주었다.

    - 하지만, 기본 경로에 해당 파일을 위치시키면 아주 편하게 사용할 수 있다.


$ sudo mkdir /etc/ansible

$ sudo nano /etc/ansible/hosts


[staging]

192.168.100.105



2. playbook 작성

    - 어떤 서버에게 어떤 일을 시킬 것인지를 적어놓는 파일을 playbook 이라고 한다.

    - ping을 하는 것을 하나 만들어보자.


$ nano ./ping-test.yml


- hosts: all

  tasks:

    - name: ping

      action: ping



3. playbook 실행

    - 앞에서 작성한 hosts 파일과 playbook을 이용하여 일을 시켜보자.


$ ansible-playbook ./ping-test.yml


PLAY [all] ***********************************************************************************************************


TASK [Gathering Facts] ********************************************************************************************

ok: [192.168.100.105]


TASK [ping] ********************************************************************************************************

ok: [192.168.100.105]


PLAY RECAP *********************************************************************************************************************

192.168.100.105            : ok=2    changed=0    unreachable=0    failed=0



혹시 노예(Slave)가 말을 잘 듣지 않는 경우라면... 주인의 키를 노예에게 알려주지 않은 것이 아닌지 확인해보자.

    - http://www.whatwant.com/395




Ansible 관련 문서나 가이드들이 꽤 많이 검색이 되지만,

나처럼 멍청한 사람을 위한 친절하고 쉬운 가이드가 없어서 고생하고 있다.


일단, 위의 가장 단순한 형태의 Sample로 playbook을 이용하는 방법을 맛보자!


다음 기회에 한 발 더 걸음을 내딪어보자.


반응형

지금 어떤 포트가 사용되고 있는지 확인하고 싶을 때 어떻게 해야할까?!

뭐 사실 포트를 확인할 수 있는 명령어가 있다는 것은 누구나 알고 있지만,
어떤 옵션을 사용해야 편하게 현재 상태를 볼 수 있는지는 잘 기억이 나지 않는다.

그래서 기록해놓는 의미로 포스팅을 해본다.

내가 레퍼런스로 삼은 포스팅은 아래와 같다.

    - http://www.tutorialarena.com/blog/check-open-ports-on-ubuntu-linux.php


명령어와 옵션은 심플하다.


$ netstat -anltp

(Not all processes could be identified, non-owned process info

 will not be shown, you would have to be root to see it all.)

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 127.0.1.1:53                     0.0.0.0:*                   LISTEN         -               

tcp        0      0 0.0.0.0:22                        0.0.0.0:*                   LISTEN         -               

tcp        0      0 127.0.0.1:631                   0.0.0.0:*                   LISTEN          -               

tcp        0      0 10.0.2.15:57424                103.22.220.133:80      TIME_WAIT    -               

tcp6       0      0 :::22                               :::*                         LISTEN          -               

tcp6       0      0 ::1:631                            :::*                         LISTEN          -


위의 메시지를 유심히 잘 살펴보기 바란다.

결과 내용이 뭔가 부족하다.


$ sudo netstat -anltp

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State         PID/Program name

tcp        0      0 127.0.1.1:53                     0.0.0.0:*                   LISTEN        1045/dnsmasq    

tcp        0      0 0.0.0.0:22                        0.0.0.0:*                   LISTEN        3517/sshd       

tcp        0      0 127.0.0.1:631                   0.0.0.0:*                   LISTEN         729/cupsd       

tcp        0      0 10.0.2.15:57424                103.22.220.133:80      TIME_WAIT   -               

tcp6       0      0 :::22                              :::*                          LISTEN         3517/sshd       

tcp6       0      0 ::1:631                           :::*                          LISTEN         729/cupsd


sudo 권한으로 실행하면 (root 권한) 위와 같이 보다 확실히 결과를 확인할 수 있다.


앞으로 포트 확인을 예쁘게 잘 해보자~!!!


반응형

 

Docker에서는 이미 주어진 Image들을 다운로드 받아서 사용하고 있다.

그러면, 이러한 Image들은 어디에 있는 것일까?!

 

"Docker Hub"라는 공식적으로 운영하고 있는 Image Server가 바로 그 곳이다.

 

이름에서 떠오르는 것과 같이.... GitHub와 같은 역할을 하는 아이다.

소스코드가 아닌 Docker Image를 저장하는 그 곳!

명령어도 유사하다~

 

 

 

 

 

그런데, 우리는 (나 혼자만?) 공식적인 것 말고.... 사적인 것, 나만의 것을 갖고 싶은 욕구가 있다.

즉, 나만의 Docker Hub를 운영하고 싶으면 어떻게 해야할까?

 

 

 

이럴 때 필요한 구글신께 외치는 주문~!!!

   - Docker Registry Server Install

 

그러면, 게시를 내려주시는 우리의 구글신님~!!!

   - https://docs.docker.com/registry/deploying/

 

 

 

 

우리가 지금부터 해야할 것은 "Docker Registry Server"를 구축하는 것이다.

 

 

 

 

 

Docker와 관련이 있는 것이니만큼, Docker Registry Server 역시 Docker 이미지로 배포가 된다.

즉, 별도의 설치과정 없이 이미지를 다운로드 받아서 실행하면 된다는...

 

하지만, 언제나처럼 제대로 사용하기 위해서는 공부를 해야하고, 시행착오를 겪어야 한다는... ^^

 

 

 

 

 

일단, Docker를 설치해야한다.

   - [ Docker Install (Ubuntu 14.04 - 64bit) - using Download ] : http://www.whatwant.com/863

 

 

 

이제 우리가 필요한 Registry Server의 이미지를 땡겨오자.

 

$ sudo docker pull registry
Using default tag: latest
latest: Pulling from library/registry
90f4dba627d6: Pull complete
3a754cdc94a5: Pull complete
0756a217635f: Pull complete
f82b9495c796: Pull complete
154ef19ddee6: Pull complete
Digest: sha256:5eaafa2318aa0c4c52f95077c2a68bed0b13f6d2b464835723d4de1484052299
Status: Downloaded newer image for registry:latest

 

$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
registry              latest              c2a449c9f834         3 days ago          33.2 MB
hello-world         latest              1815c82652c0        2 weeks ago         1.84 kB

 

 

 

 

실행은 간단하다.

 

$ sudo docker run --name my-registry -d --restart=always -p 5000:5000 registry
0af462462b05ea13191470dff48ab52edf2206b65c885d2d82fd5c319daca63a

 

$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
0af462462b05        registry            "/entrypoint.sh /e..."   9 seconds ago       Up 8 seconds        0.0.0.0:5000->5000/tcp   my-registry

 

"--name" 옵션 뒤에 앞으로 사용할 Container 이름을 임의로 지어주면 되고...

"-d" 옵션을 통해서 Daemon으로 실행하고 싶다고 알려주고~

"--restart=always" 옵션을 통해서 Container 안에서 프로세스가 죽더라도 항상 재시작을 하도록 하고~

"-p" 옵션으로 포트 매핑을 해주면 된다.

 

제일 뒤에는 원본(?)으로 사용할 이미지를 지정해준다.

 

ps를 통해서 실행되고 있는 모습을 확인해볼 수 있다.

 

 

 

 

 

지금 실행해 놓은 Registry를 실험해보기 위해서, 등록해볼 마루타를 하나 만들어보자.

 

 

 

Dockerfile을 하나 만들어보자.

 

$ nano ./Dockerfile

 

FROM busybox
MAINTAINER whatwant <whatwant@gmail.com>
CMD /bin/echo "hi-world!!"

 

방금 만든 마루타의 Dockerfile을 빌드해서 이미지로 만들어보자.

 

$ sudo docker build -t hi-world .
Sending build context to Docker daemon 2.048 kB
Step 1/3 : FROM busybox
 ---> c30178c5239f
Step 2/3 : MAINTAINER whatwant <whatwant@gmail.com>
 ---> Running in 6115aa49c789
 ---> efaf526395ee
Removing intermediate container 6115aa49c789
Step 3/3 : CMD /bin/echo "hi-world!!"
 ---> Running in b57e417ec463
 ---> 0983858cdd37
Removing intermediate container b57e417ec463
Successfully built 0983858cdd37

 

$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hi-world            latest              0983858cdd37     14 seconds ago       1.11 MB
registry             latest              c2a449c9f834        3 days ago           33.2 MB
busybox            latest              c30178c5239f        2 weeks ago         1.11 MB
hello-world       <none>           1815c82652c0        2 weeks ago         1.84 kB

 

 

 

이미지를 만들었으면, 이제는 우리의 Registry Server에 등록을 해보자.

 

$ sudo docker tag hi-world localhost:5000/hi-world


$ sudo docker push localhost:5000/hi-world
The push refers to a repository [localhost:5000/hi-world]
3a1dff9afffd: Pushed
latest: digest: sha256:b182254942f5ffeb903b7125c4693e12c2330db6c16a75681e76c633535edade size: 527

 

잘 등록되었는지 확인도 해보자.

 

$ curl -X GET http://localhost:5000/v2/_catalog
{"repositories":["hi-world"]}

 

$ curl -X GET http://localhost:5000/v2/hi-world/tags/list
{"name":"hi-world","tags":["latest"]}

 

 

 

 

이번에는 Registry Server를 제대로 사용할 수 있는지 확인해보자.

그런데, 이미 가지고 있는 이미지들이 있으니 테스트를 위해서 확인하고 지워놓자.

 

$ sudo docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
hi-world                  latest              81d1537591cc        32 minutes ago      1.11 MB
localhost:5000/hi-world   latest              81d1537591cc        32 minutes ago      1.11 MB
registry                  latest              c2a449c9f834        3 days ago          33.2 MB
busybox                   latest              c30178c5239f        2 weeks ago         1.11 MB
hello-world               latest              1815c82652c0        2 weeks ago         1.84 kB

 

hi-world, localhost:5000/hi-world 2개의 이미지가 있다. 지우자!

 

$ sudo docker rmi hi-world
Untagged: hi-world:latest


$ sudo docker rmi localhost:5000/hi-world
Untagged: localhost:5000/hi-world:latest
Untagged: localhost:5000/hi-world@sha256:410ad4c96024f632bde893190d71a3c10457419c50375ab1d878f2ad67d76775
Deleted: sha256:81d1537591cc43e879aeed3e0556788f9b6b75ab6377fd1db6c9266472f27f09
Deleted: sha256:358acd2e8b9f52adffcdd2870487bdc36d7842677d602ffdf533776ac55a7574

 

$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
registry            latest              c2a449c9f834        3 days ago          33.2 MB
busybox             latest              c30178c5239f        2 weeks ago         1.11 MB
hello-world         latest              1815c82652c0        2 weeks ago         1.84 kB

 

hi-world 이미지가 없는 것을 확인했다.

이제 땡겨오자.

 

 

$ sudo docker pull localhost:5000/hi-world
Using default tag: latest
latest: Pulling from hi-world
27144aa8f1b9: Already exists
Digest: sha256:410ad4c96024f632bde893190d71a3c10457419c50375ab1d878f2ad67d76775
Status: Downloaded newer image for localhost:5000/hi-world:latest

 

$ sudo docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
localhost:5000/hi-world   latest              81d1537591cc        33 minutes ago      1.11 MB
registry                  latest              c2a449c9f834        3 days ago          33.2 MB
busybox                   latest              c30178c5239f        2 weeks ago         1.11 MB
hello-world               latest              1815c82652c0        2 weeks ago         1.84 kB

 

잘 받아온 것을 확인했다.

 

 

동작이 잘되는지도 확인해보자.

 

$ sudo docker run localhost:5000/hi-world
hi-world!!

 

물론 잘된다.

 





혹시 아래와 같은 에러가 발생할 경우에는...


$ sudo docker pull xxx.xxx.xx.xx:5000/asdf

Using default tag: latest

Error response from daemon: Get https://xxx.xxx.xxx.xxx:5000/v1/_ping: http: server gave HTTP response to HTTPS client



아래와 같이 환경설정을 해주면 된다.


$ sudo nano /etc/default/docker

 

...

# Use DOCKER_OPTS to modify the daemon startup options.

#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

DOCKER_OPTS="--insecure-registry xxx.xxx.xxx.xxx:5000"

...


$ sudo service docker restart

 



 

기본적인 사항은 여기까지 해서 살펴보았지만...

아직 사용하기에는 문제가 많이 있는 상태이다.

 

당장 인증 관련한 부분에 있어서 문제가 있다. 아무나 쓸 수 있도록 한다면 뭐 무방하지만.... ^^

LDAP과 같은 계정서버와의 연계라던지 아니면 로드밸런싱이라던지... 등 알아봐야할게 아직 많다.

 

뭐 일단, 이번 포스트는 여기까지~

 

반응형


Ansible은 장점이 많은 도구인 것 같다.

첫번째로 Master에만 설치하면 된다는 점에서 좋고, 두번째로는 SSH 기반으로 일을 한다는 것이 좋다!



 

 

지난 포스팅을 통해서 Master 역할을 할 아이에게 Ansible을 설치했다는 전제 하에 설명을 진행하겠다.

    - [ Ansible Source Install (Ubuntu 14.04) ] : http://www.whatwant.com/865

 

 

 

 

그 다음 해야할 첫번째 일은... Master에서 Slave로 SSH로 접근할 수 있는 길을 만드는 것이다.

    - [ SSH Public Key - SSH 공개키 ] : http://www.whatwant.com/395

 

Master에서 ssh 키를 생성하고나서 Slave들에게 public-key를 넣어주면 된다.

 

 

 

 

 

이제 해야할 일은 Ansible에게 Slave가 누군지를 알려줘야 한다.

hosts 파일을 만들자. 꼭 이름을 "hosts"라고 해야하는 것은 아니다.

 

$ nano ./hosts

 

Slave IP 정보를 적어주면 된다. 꼭 "[Staging]"이라고 이름을 지어야 하는 것은 아니다.

 

[staging]
192.168.100.105

 

 

 

주인의 명령을 듣는 노예(Slave)들에게는 내가 주인인 것을 알려주는 열쇠가 필요하다. SSH Public-Key

    - http://www.whatwant.com/395


주인의 키를 노예에게 넣어놓자!


 

 

Slave와 잘 통하는지 알아보자.

 

$ ansible all -m ping -i ./hosts -u u14
192.168.100.105 | SUCCESS => {
    "changed": false,
    "failed": false,
    "ping": "pong"
}

 

"-i" 옵션 뒤에는 앞에서 만든 hosts 파일을 지정해주면 되고.

"-u" 옵션 뒤에는 Slave에 접근할 계정을 지정해주면 된다.

 

 

 

 

그럼 간단한 명령어를 원격으로 날려보자.

 

$ ansible -i ./hosts staging -u u14 -m command -a "ls -ahl"
192.168.100.105 | SUCCESS | rc=0 >>
합계 140K
drwxr-xr-x 18 u14  u14  4.0K  7월  2 03:38 .
drwxr-xr-x  3 root root 4.0K  8월  9  2015 ..
-rw-------  1 u14  u14  7.4K  7월  2 03:37 .ICEauthority
-rw-------  1 u14  u14    53  7월  2 03:37 .Xauthority
drwx------  3 u14  u14  4.0K  6월 25 19:07 .ansible
-rw-------  1 u14  u14  2.0K  6월 26 00:35 .bash_history
-rw-r--r--  1 u14  u14   220  8월  9  2015 .bash_logout
-rw-r--r--  1 u14  u14  3.6K  8월  9  2015 .bashrc
drwx------ 14 u14  u14  4.0K  6월 25 14:58 .cache
drwx------  3 u14  u14  4.0K  8월  9  2015 .compiz
drwx------ 14 u14  u14  4.0K  8월  9  2015 .config
drwx------  3 u14  u14  4.0K 12월 12  2016 .dbus
drwx------  3 u14  u14  4.0K  7월  2 03:37 .gconf
drwx------  3 u14  u14  4.0K  8월  9  2015 .local
-rw-r--r--  1 u14  u14   675  8월  9  2015 .profile
drwxrwxr-x  2 u14  u14  4.0K  6월 25 18:59 .ssh
-rw-r-----  1 u14  u14     5  7월  2 03:37 .vboxclient-clipboard.pid
-rw-r-----  1 u14  u14     5  7월  2 03:37 .vboxclient-display.pid
-rw-r-----  1 u14  u14     5  7월  2 03:37 .vboxclient-draganddrop.pid
-rw-r-----  1 u14  u14     5  7월  2 03:37 .vboxclient-seamless.pid
-rw-rw-r--  1 u14  u14   131  8월  9  2015 .xinputrc
-rw-------  1 u14  u14    54  7월  2 03:37 .xsession-errors
-rw-------  1 u14  u14   833  7월  2 03:11 .xsession-errors.old
-rw-r--r--  1 u14  u14  8.8K  8월  9  2015 examples.desktop
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 공개
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 다운로드
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 문서
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 바탕화면
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 비디오
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 사진
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 음악
drwxr-xr-x  2 u14  u14  4.0K  8월  9  2015 템플릿

 

 

"$ sudo apt-get -y upgrade" 명령어 등을 이용하면...^^

 

 

 

 

Ansible을 이용해서 Slave에 접근하는 것에 대해서 살짝 맛만 봤다.

제대로 이용하기 위해서는 playbook 등을 이용해야하지만, 지금은 맛만 살짝~




다음에 기회가 되면 계속 이어가보겠다~



 

반응형

2019.07.07


간만에 해보려고 했더니, 에러가 발생한다.

공식 가이드에도 14.04 버전에 대한 가이드 내용이 사라졌다.

아래 내용은 그냥 참고만 하시길...


============================================================================================


공식 홈페이지에 너무나 잘 나와있다.

- https://docs.docker.com/engine/installation/linux/ubuntu/



공식 홈페이지 내용 참고해서 직접 해보면서 진행했던 내용의 기록이다.

하나씩 따라가보자.


※ 이 블로그를 계속 봐오신 분들은 아시겠지만... 아래 내용은 직접 실행해보면서 작성한 것입니다.

※ VirtualBox를 이용하여 해당 OS를 설치하고 update까지만 마친 상태에서 진행하였습니다.




1. Ubuntu version

    - Docker에 대한 환상을 갖고 있었다. OS에 의존하지 않고 자유로운.... 하지만 꽝!

    - Ubuntu 14.04, 16.04, 16.10 만 지원하고 있다.

    - 특히, 64bit 만 지원한다! 32bit 안된다!



2. 필요 패키지 설치 (Ubuntu 14.04)

    - Ubuntu 14.04 버전에서만 하면 된다고 한다.


sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual



3. Binary 확인

    - 웹으로 다운로드 받을 버전을 확인하자.




4. Download 받기


$ wget https://download.docker.com/linux/ubuntu/dists/trusty/pool/stable/amd64/docker-ce_17.03.1~ce-0~ubuntu-trusty_amd64.deb



5. Docker 설치하기


sudo dpkg --install ./docker-ce_17.03.1~ce-0~ubuntu-trusty_amd64.deb



6. Hello World


$ sudo docker run hello-world

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

78445dd45222: Pull complete 

Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7

Status: Downloaded newer image for hello-world:latest


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/



끝~

반응형

 


공식 홈페이지에 너무나 잘 나와있다.

- https://docs.docker.com/engine/installation/linux/ubuntu/



공식 홈페이지 내용 참고해서 직접 해보면서 진행했던 내용의 기록이다.

하나씩 따라가보자.


※ 이 블로그를 계속 봐오신 분들은 아시겠지만... 아래 내용은 직접 실행해보면서 작성한 것입니다.

※ VirtualBox를 이용하여 해당 OS를 설치하고 update까지만 마친 상태에서 진행하였습니다.




1. Ubuntu version

    - Docker에 대한 환상을 갖고 있었다. OS에 의존하지 않고 자유로운.... 하지만 꽝!

    - Ubuntu 14.04, 16.04, 16.10 만 지원하고 있다.

    - 특히, 64bit 만 지원한다! 32bit 안된다!



2. 필요 패키지 설치 (Ubuntu 14.04)

    - Ubuntu 14.04 버전에서만 하면 된다고 한다.


sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual



3. GPG Key 등록 준비


sudo apt-get install apt-transport-https ca-certificates curl software-properties-common



4. GPG Key 등록하기


curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88



5. apt 소스 리스트 추가하기


sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

$ sudo apt-get update



6. Docker 설치하기


sudo apt-get install docker-ce



7. Hello World


$ sudo docker run hello-world

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

78445dd45222: Pull complete 

Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7

Status: Downloaded newer image for hello-world:latest


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/



끝~

반응형

 

우선 한 가지 전제를 하고 포스팅을 하겠다.

필자는 LDAP에 대한 기본 지식이 없다. 그냥 막 쓰고 싶은 마음만 갖고 있을 뿐이다.

 

 

1. phpLDAPadmin 화면

 

   - 설치 후 처음으로 보인 화면이다.

 

 

 

 

2. dc ? cn ?

 

   - 무언가 약자가 많이 등장한다. 무슨 의미일까?

   - 우선 아래에 나열한 정도로 만족하자.

 

entry 

  attribute

dc

Domain Component

  도메인에 대한 요소

cn

Common Name

  이름

sn

Sir Name

  성 (Family Name)

ou

Organization Unit

  그룹 (조직)

dn

Distinguished Name

  특정한 사용자를 구분할 수 있는 고유의 이름

 

 

 

3. "Create new entry here" and warning !

 

   - 새로운 무언가를 생성해보기 위해서 "Create new entry here"를 선택하니 경고 화면이 나왔다.

 

 

   - "template"과 관련된 무언가가 잘 맞지 않는 것으로 보인다. 정리해보자.

 

$ sudo su

$ cd /etc/phpldapadmin/templates/creation

$ mkdir bak
$ mv ./sambaSamAccount.xml ./bak/
$ mv ./courierMailAlias.xml ./bak/

$ mv ./mozillaOrgPerson.xml ./bak/

$ service slapd restart

 

   - 문제가 되는 것들을 전부 치워놓고 서비스 재시작 한 후 다시 접근하면...

 

 

   - 이제서야 뭔가 제대로 된 것처럼 보인다.

   - (x) 표시가 된 것을을 보면... 방금 한 행위들이 어떤 의미인지 살짝 엿보인다.

 

 

하나씩 알아나가 보자.

 

반응형

'Development Tools > OpenLDAP' 카테고리의 다른 글

phpLDAPadmin - Group 만들기  (0) 2014.12.30
OpenLDAP (Ubuntu 14.04, Package)  (0) 2014.12.08

+ Recent posts