origoni's Blog from Millky

origoni의 스프링 블로그 입니다.

CentOS 7 에 Docker 설치하고 최신 버전으로 업그레이드 하기

우선 테스트로 CentOS 7 미니멀 버전으로 설치를 진행하였다.

http://centos.mirror.cdnetworks.com/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso



CentOS 7의 경우 아래와 같이 바로 설치할 수 있다.

$ yum -y install docker

...

---> Package docker.x86_64 0:1.2.0-1.8.el7.centos will be installed


위와 같이 도커 1.2.0 이 설치가 된다.


[root@CentOS7x ~]# version

-bash: version: command not found

[root@233-CentOS7x ~]# docker version

Client version: 1.2.0

Client API version: 1.14

Go version (client): go1.3.3

Git commit (client): 2a2f26c/1.2.0

OS/Arch (client): linux/amd64

2014/12/02 18:20:44 Get http:///var/run/docker.sock/v1.14/version: dial unix /var/run/docker.sock: no such file or directory



바로 stackoverflow 문의 결과를 활용하여 최신버전으로 업데이트를 진행해 보겠다.


CentOS 7 Minimal 의 경우 wget가 없다;;

먼저 설치

$ yum -y install wget



혹시 Docker이 올라가 있다면 중지 시킨다.

service docker stop



그리고 최신 버전으로 교채!

# wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker

--2014-12-02 18:25:34--  https://get.docker.com/builds/Linux/x86_64/docker-latest

Resolving get.docker.com (get.docker.com)... 162.242.195.82

Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 14173183 (14M) [binary/octet-stream]

Saving to: ‘/usr/bin/docker’


100%[=====================>] 14,173,183   394KB/s   in 37s


도커 시작!

service docker start



이제 버전을 확인 해보자~

# docker version

Client version: 1.3.2

Client API version: 1.15

Go version (client): go1.3.3

Git commit (client): 39fa2fa

OS/Arch (client): linux/amd64

Server version: 1.3.2

Server API version: 1.15

Go version (server): go1.3.3

Git commit (server): 39fa2fa


잘 동작하고 있다.



역시 stackoverflow ㅎㅎ

참조 : http://stackoverflow.com/questions/26472586/upgrade-docker-on-centos-7



origoni 2014-12-02 19:20:56

# docker run centos:centos7 /bin/echo 'Hello World'
2014/12/02 18:50:32 Post http:///var/run/docker.sock/v1.15/containers/create: dial unix /var/run/docker.sock: no such file or directory
[root@233-CentOS7x ~]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@233-CentOS7x ~]# docker run centos:centos7 /bin/echo 'Hello World'
Unable to find image 'centos:centos7' locally
centos:centos7: The image you are pulling has been verified
511136ea3c5a: Pull complete
5b12ef8fd570: Pull complete
ae0c2d0bdc10: Pull complete
Status: Downloaded newer image for centos:centos7
Hello World
back to top