docker建立鏡像及push鏡像出錯問題

docker build  出錯docker

Got permission denied while trying to connect to the 
Docker daemon socket at unix:///var/run/docker.sock:
Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=
&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerf
ile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=ntdlgho4p5wt
906yywzo9pcdd&shmsize=0&t=gamehall%3Av1.6.38&target=&ulimits=null&version=1: dial
unix /var/run/docker.sock: connect: permission denied

解決方法:json

su #切換到root
groupadd docker #添加docker用戶組
gpasswd -a $USER docker #將登錄用戶加入到docker用戶組中 newgrp docker #更新用戶組 docker ps #測試docker命令是否可使用

docker push出錯vim

錯誤1:session

Get https://hub.xxx.com/v1/_ping: dial tcp 192.168.1.8:443: getsockopt: connection refused

解決方法:socket

vim /etc/docker/daemon.json   添加 { "insecure-registries":["hub.xxxxx.com"] }

重啓 docker tcp

systemctl restart docker測試

systemctl restart docker.serviceui

 

錯誤2:spa

denied: requested access to the resource is deniedunix

解決方法

docker login $你的鏡像站點
相關文章
相關標籤/搜索