1. curl 을 통해 docker 를 설치합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | $ curl -s https://get.docker.com/ |sudo sh # Executing docker install script, commit: 49ee7c1 + sh -c apt-get update -qq >/dev/null + sh -c apt-get install -y -qq apt-transport-https ca-certificates curl software-properties-common >/dev/null + sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null + sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list + [ ubuntu = debian ] + sh -c apt-get update -qq >/dev/null + sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null + sh -c docker version Client: Version: 17.10.0-ce API version: 1.33 Go version: go1.8.3 Git commit: a4aab13 Built: Tue Oct 17 19:04:16 2017 OS/Arch: linux/amd64 Server: Version: 17.10.0-ce API version: 1.33 (minimum version 1.12) Go version: go1.8.3 Git commit: a4aab13 Built: Tue Oct 17 19:02:56 2017 OS/Arch: linux/amd64 Experimental: false If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -aG docker your-user Remember that you will have to log out and back in for this to take effect! WARNING: Adding a user to the "docker" group will grant the ability to run containers which can be used to obtain root privileges on the docker host. Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information. | cs |
2. docker 설치 여부 확인
1 2 | $ docker --version Docker version 17.10.0-ce, build a4aab13 | cs |
3. docker 관련 계정 권한 부여
1 2 | $ sudo usermod -aG docker $USER | cs |
* docker 를 사용하는데 있어서 root 권한이 필요하기 때문에 sudo 명령어 없이 사용하기 위해선 docker 그룹에 추가하여 사용합니다.
* $USER 는 현재 접속 중인 사용자 계정을 뜻합니다.
1 2 3 | $ echo $USER test | cs |
4. 해당 계정의 권한 부여 후 docker service 를 재시작합니다.
1 2 | $ sudo service docker restart | cs |
5. docker service 상태 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | $ sudo service docker status ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since 화 2017-11-07 08:56:58 KST; 5h 2min ago Docs: https://docs.docker.com Main PID: 1810 (dockerd) Tasks: 108 Memory: 101.6M CPU: 45.866s CGroup: /system.slice/docker.service ├─31199 /usr/bin/dockerd -H fd:// └─31209 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interva 11월 07 09:33:58 user-virtual-machine dockerd[1810]: time="2017-11-07T09:33:58.343006586+09:00" level=info msg="IPv6 11월 07 09:34:05 user-virtual-machine dockerd[1810]: time="2017-11-07T09:34:05.471960716+09:00" level=info msg="No no 11월 07 09:34:05 user-virtual-machine dockerd[1810]: time="2017-11-07T09:34:05.471981845+09:00" level=info msg="IPv6 11월 07 10:26:14 user-virtual-machine dockerd[1810]: time="2017-11-07T10:26:14.155667691+09:00" level=info msg="No no 11월 07 10:26:14 user-virtual-machine dockerd[1810]: time="2017-11-07T10:26:14.155858855+09:00" level=info msg="IPv6 11월 07 11:02:48 user-virtual-machine dockerd[1810]: time="2017-11-07T11:02:48.680378252+09:00" level=info msg="Layer 11월 07 11:02:48 user-virtual-machine dockerd[1810]: time="2017-11-07T11:02:48.796188131+09:00" level=info msg="No no 11월 07 11:02:48 user-virtual-machine dockerd[1810]: time="2017-11-07T11:02:48.796608566+09:00" level=info msg="IPv6 11월 07 11:04:36 user-virtual-machine dockerd[1810]: time="2017-11-07T11:04:36.887127001+09:00" level=info msg="No no 11월 07 11:04:36 user-virtual-machine dockerd[1810]: time="2017-11-07T11:04:36.887638516+09:00" level=info msg="IPv6 | cs |
'Operating System > Linux' 카테고리의 다른 글
[에러] cp: omitting directory (0) | 2017.11.23 |
---|---|
파일 내의 문자열 검색 (0) | 2017.11.21 |
ubuntu curl 설치 (0) | 2017.11.07 |
centos user 추가 (0) | 2017.11.06 |
ubuntu 설치된 패키지 목록 확인 (0) | 2017.11.06 |