IT. POST LIST

POST ALL LABEL

DOCKER - 기본설치

By 때찌때찌맴매 - 4월 04, 2018



DOCKER 기본설치

** 해당 작업은 centos7, ubuntu 1.04 에서 진행했습니다.

*참조 : https://subicura.com/2017/01/19/docker-guide-for-beginners-2.html

[ 스크립트 설치 ] 
[root@localhost 10:23:58:~]# curl -fsSL https://get.docker.com/ | sh

*해당 작업들을 진행 해야 docker server 가 올라옴
usermod -aG docker $USER # 현재 접속중인 사용자에게 권한주기
usermod -aG docker your-user # your-user 사용자에게 권한주기

[ex]
[root@localhost 10:23:58:~]# usermod -aG docker root

[root@localhost 10:23:58:~]# systemctl start docker.service
[root@localhost 10:24:02:~]# ps -ef| grep docker
root     18912     1  2 10:24 ?        00:00:00 /usr/bin/dockerd
root     18916 18912  0 10:24 ?        00:00:00 docker-containerd --config /var/run/docker/containerd/containerd.toml
root     19035 18637  0 10:24 pts/0    00:00:00 grep --color=auto docker
[root@localhost 10:24:07:~]# docker version 
Client:
 Version: 18.03.0-ce
 API version: 1.37
 Go version: go1.9.4
 Git commit: 0520e24
 Built: Wed Mar 21 23:09:15 2018
 OS/Arch: linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version: 18.03.0-ce
  API version: 1.37 (minimum version 1.12)
  Go version: go1.9.4
  Git commit: 0520e24
  Built: Wed Mar 21 23:13:03 2018
  OS/Arch: linux/amd64
  Experimental: false

* 권한 작업을 진행 하지 않으면 에러 메시지와 client 만 올라오는 것 을 확인 할 수 있습니다.
[ yum, apt-get 설치 ]
[ centos 7 ]
[root@localhost 10:25:24:~]# yum install docker -y

[ ubuntu 16.04 ]
[root@localhost 11:25:24:~]# apt-get install docker.io -y

[ docker 이미지 다운 및 실행 ]
* centos7 에서 ubuntu 16.04 이미지는 docker로 연결합니다.

[root@localhost 10:25:24:~]# docker run ubuntu:16.04
Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
22dc81ace0ea: Pull complete 
1a8b3c87dba3: Pull complete 
91390a1c435a: Pull complete 
07844b14977e: Pull complete 
b78396653dae: Pull complete 
Digest: sha256:e348fbbea0e0a0e73ab0370de151e7800684445c509d46195aef73e090a49bd6
Status: Downloaded newer image for ubuntu:16.04

[root@localhost 10:26:16:~]# docker run --rm -it ubuntu:16.04 /bin/bash
root@f1355585392a:/# ll
total 20
drwxr-xr-x  21 root root 4096 Mar 27 01:27 ./
drwxr-xr-x  21 root root 4096 Mar 27 01:27 ../
-rwxr-xr-x   1 root root    0 Mar 27 01:27 .dockerenv*
drwxr-xr-x   2 root root 4096 Feb 28 19:14 bin/
drwxr-xr-x   2 root root    6 Apr 12  2016 boot/
drwxr-xr-x   5 root root  360 Mar 27 01:27 dev/
drwxr-xr-x  42 root root 4096 Mar 27 01:27 etc/
drwxr-xr-x   2 root root    6 Apr 12  2016 home/
drwxr-xr-x   8 root root   96 Sep 13  2015 lib/
drwxr-xr-x   2 root root   34 Feb 28 19:14 lib64/
drwxr-xr-x   2 root root    6 Feb 28 19:13 media/
drwxr-xr-x   2 root root    6 Feb 28 19:13 mnt/
drwxr-xr-x   2 root root    6 Feb 28 19:13 opt/
dr-xr-xr-x 117 root root    0 Mar 27 01:27 proc/
drwx------   2 root root   37 Feb 28 19:14 root/
drwxr-xr-x   5 root root   58 Feb 28 19:14 run/
drwxr-xr-x   2 root root 4096 Mar  6 22:17 sbin/
drwxr-xr-x   2 root root    6 Feb 28 19:13 srv/
dr-xr-xr-x  13 root root    0 Mar 27 01:27 sys/
drwxrwxrwt   2 root root    6 Feb 28 19:14 tmp/
drwxr-xr-x  10 root root  105 Feb 28 19:13 usr/
drwxr-xr-x  11 root root  139 Feb 28 19:14 var/
root@f1355585392a:/# uname -a
Linux f1355585392a 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
root@f1355585392a:/# cat /etc/issue
Ubuntu 16.04.4 LTS \n \l

  • Share:

You Might Also Like

0 개의 댓글