티스토리 뷰

728x90
반응형

본 포스팅에서는 docker login시 Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
에러에 대한 가이드를 진행합니다.

 

환경은 linux / docker를 구성하구 1.1.1.1 server에 docker repository k8s-master가 위치합니다.

docker login을 위한 repository를 다음과 같이 추가합니다.

추가한 docker repository는 다음과 같구요.

[root@kmkang ~]# cat /etc/docker/daemon.json
{
 "insecure-registries" : ["k8s-master:5000"]
}
[root@kmkang ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
0.0.0.0    nrson
1.1.1.1    k8s-master
[root@kmkang ~]#

 

[Error Message]

[root@kmkang ~]# docker login k8s-master:5000
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default:
https://index.docker.io/v1/
Username: oss-was
Password:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@kmkang ~]#

 

으잉? 분명 비번 정확히 입력한거 같은데?

왜 안되지 하시는 분은 지금 바로 따라해 보세요!

 

[해결방안]

1) docker 기동 상태 확인 (sudo systemctl status docker)

[root@kmkang ~]# sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com
[root@kmkang ~]#

2) docker Process 기동 상태 확인 (ps -ef | grep java)

[root@kmkang ~]# ps -ef | grep java

[root@kmkang ~]#

3) docker Process 기동 (systemctl start docker)

[root@kmkang ~]# systemctl start docker
[root@kmkang ~]#

4) docker Process 기동 상태 확인 및 status 체크

[root@kmkang ~]# ps -ef | grep java
root     17634 16548  0 17:21 pts/0    00:00:00 grep --color=auto java
wildfly  19371 19251  0 10월12 ?      00:03:09 /usr/local/jdk1.8.0_152/bin/java -D[Standalone] -server -XX:+UseCompressedOops -verbose:gc -Xloggc:/home/wildfly/jboss64/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms2000m -Xmx2000m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true -Dorg.jboss.boot.log.file=/home/wildfly/jboss64/standalone/log/server.log -Dlogging.configuration=file:/home/wildfly/jboss64/standalone/configuration/logging.properties -jar /home/wildfly/jboss64/jboss-modules.jar -mp /home/wildfly/jboss64/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/home/wildfly/jboss64 -Djboss.server.base.dir=/home/wildfly/jboss64/standalone -Djboss.server.base.dir=/home/wildfly/jboss64/standalone -Djboss.node.name=standalone -c standalone.xml -b 0.0.0.0 -bmanagement=172.21.70.24 -Djboss.socket.binding.port-offset=50
[root@kmkang ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since 월 2018-10-15 17:21:37 KST; 18min ago
     Docs: https://docs.docker.com
 Main PID: 17448 (dockerd)
   Memory: 128.1M
   CGroup: /system.slice/docker.service
           ├─17448 /usr/bin/dockerd
           └─17463 docker-containerd --config /var/run/docker/containerd/containerd.toml

10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.134236248+09:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.194257003+09:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.194878975+09:00" level=info msg="Loading containers: start."
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.394175549+09:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.434969277+09:00" level=info msg="Loading containers: done."
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.436848622+09:00" level=warning msg="Not using native diff for overlay2, this may cause degraded performance for building images: opaque flag erroneous... or later to fix"
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.667620835+09:00" level=info msg="Docker daemon" commit=0520e24 graphdriver(s)=overlay2 version=18.03.0-ce
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.668316077+09:00" level=info msg="Daemon has completed initialization"
10월 15 17:21:37 kmkang dockerd[17448]: time="2018-10-15T17:21:37.675890131+09:00" level=info msg="API listen on /var/run/docker.sock"
10월 15 17:21:37 kmkang systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@kmkang ~]#

원인은 docker daemon이 기동되어야 docker login 수행이 가능하기 때문이네요.

 

자 그럼 다시 로그인 해 보도록 할까요?

[root@kmkang ~]# docker login k8s-master:5000
Username: oss-was
Password:
Login Succeeded
[root@kmkang ~]#

 

오 역시 잘되네요.

지금까지 docker repository 추가 후 로그인 과정을 살펴보았습니다.

그럼 또봐요~

728x90
반응형