[docker] Docker 바이너리 설치

Install Docker CE from binaries

링크: https://docs.docker.com/install/linux/docker-ce/binaries/

 

테스트 : ubuntu1604 vm

Docker 바이너리 압축파일 Down

https://download.docker.com/linux/static/stable/x86_64/

Index of /linux/static/stable/x86_64/
../
docker-17.03.0-ce.tgz  2017-03-01 11:11  27M
docker-17.03.1-ce.tgz  2017-03-28 04:46  27M
docker-17.03.2-ce.tgz  2017-06-28 03:35  27M
docker-17.06.0-ce.tgz  2017-06-28 05:17  29M
docker-17.06.1-ce.tgz  2017-08-18 02:35  29M
docker-17.06.2-ce.tgz  2017-09-05 10:39  29M
docker-17.09.0-ce.tgz  2017-09-27 01:47  29M
docker-17.09.1-ce.tgz  2017-12-08 12:22  29M
docker-17.12.0-ce.tgz  2017-12-27 09:52  33M

 

wget down

test@ubuntu1604:~$ wget https://download.docker.com/linux/static/stable/x86_64/docker-17.12.0-ce.tgz
--2018-02-05 18:21:58--  https://download.docker.com/linux/static/stable/x86_64/docker-17.12.0-ce.tgz
Resolving download.docker.com (download.docker.com)... 54.192.183.142, 54.192.183.217, 54.192.183.121, ...
Connecting to download.docker.com (download.docker.com)|54.192.183.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34272897 (33M) [application/x-tar]
Saving to: ‘docker-17.12.0-ce.tgz’

docker-17.12.0-ce.t 100%[===================>]  32.68M  13.4MB/s    in 2.4s

2018-02-05 18:22:01 (13.4 MB/s) - ‘docker-17.12.0-ce.tgz’ saved [34272897/34272897]

test@ubuntu1604:~$

 

압축풀기

test@ubuntu1604:~$ tar xvf docker-17.12.0-ce.tgz
docker/
docker/docker-containerd-shim
docker/docker-containerd
docker/docker-runc
docker/docker
docker/docker-init
docker/docker-containerd-ctr
docker/docker-proxy
docker/dockerd
test@ubuntu1604:~$

 

docker 파일 copy 

test@ubuntu1604:~$ sudo cp docker/* /usr/bin/

 

Docker test

test@ubuntu1604:~$ sudo dockerd &
~중략
test@ubuntu1604:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED                                                                                                                                                                                                            STATUS              PORTS               NAMES
test@ubuntu1604:~$

 

docker 사용자 등록

test@ubuntu1604:~$ sudo usermod -aG docker test

 

 

systemd Scripts 생성

docker.service

sanjuk@docker-test:~$ cat /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

 

docker.socket

sanjuk@docker-test:~$ vi /lib/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API
PartOf=docker.service

[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target

 

systemctl docker enable 

test@ubuntu1604:~$ sudo -i
[sudo] password for test:
root@ubuntu1604:~# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@ubuntu1604:~# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /lib/systemd/system/docker.service.
root@ubuntu1604:~# init 6

 

docker Test

ubuntu16.04 컨테이너 실행 및 컨테이너 접속

sanjuk@ubuntu1604:~$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
sanjuk@ubuntu1604:~$ docker run ubuntu:16.04
Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
1be7f2b886e8: Pull complete
6fbc4a21b806: Pull complete
c71a6f8e1378: Pull complete
4be3072e5a37: Pull complete
06c6d2f59700: Pull complete
Digest: sha256:e27e9d7f7f28d67aa9e2d7540bdc2b33254b452ee8e60f388875e5b7d9b2b696
Status: Downloaded newer image for ubuntu:16.04
sanjuk@ubuntu1604:~$ docker run --rm -it ubuntu:16.04 /bin/bash
root@cd21ecd3c368:/# uname -a
Linux cd21ecd3c368 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@cd21ecd3c368:/# exit

 

 

 

댓글 남기기