赞
踩
docker: Error response from daemon: Head "https://registry-1.docker.io/v2/library/hello-world/manifests/latest": read tcp 192.168.1.105:59804->3.216.34.172:443: read: connection reset by peer.
- sudo mkdir -p /etc/docker
- sudo tee /etc/docker/daemon.json <<-'EOF'
- {
- "registry-mirrors": ["https://8xxvcaud.mirror.aliyuncs.com"]
- }
- EOF
- sudo systemctl daemon-reload
- sudo systemctl restart docker
解决配置镜像加速后docker起不来:配置文件是一个json格式的文件,在json文件中对齐的时候不能存在空格,直接拷贝整个tee命令执行
sudo usermod -a -G docker USERNAME && newgrp docker
when install docker it will add a new group "docker"
credential will be recorded in $HOME/.docker/config.json
GIT_AUTH_TOKEN=<token> docker buildx build \
--secret id=GIT_AUTH_TOKEN \
https://github.com/user/private.git
docker build --file test.Dockerfile - < foo.tar.gz
docker build --build-arg a=b --secret id=a,env=b
# syntax=
- [pdguser@localhost ~]$ docker swarm join --token SWMTKN-1-3krq7qkuscnh5o91q1w4r1ps041ipatc8ne4y2qgqbu7o6qy44-a862je8dng2vxnuuc5q7jg3gt 192.168.73.255:2377
- Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.73.255:2377: connect: network is unreachable"
- [pdguser@localhost ~]$ docker swarm join --token SWMTKN-1-1awgiow7j7dvs8651chiiiqdn6pxs6ui085hcc018zh5baahpf-d5dgh42kcw4xziy8k60j7q6ij 192.168.73.141:2377
- Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.73.141:2377: connect: no route to host"
- [pdguser@localhost ~]$ docker swarm join --token SWMTKN-1-1awgiow7j7dvs8651chiiiqdn6pxs6ui085hcc018zh5baahpf-d5dgh42kcw4xziy8k60j7q6ij 192.168.73.141:2377
- Error response from daemon: remote CA does not match fingerprint. Expected: 3445a1a11bac390f8d09bd7f31149c5d3c3a1ae6b7f712ebf3feca93ba3d5e23
- [pdguser@localhost ~]$ docker swarm join --token SWMTKN-1-1h0378e5d715ufrsp8xcr82rpfh3t02yb5pux0lhxsrffp374j-5rxjx15oeud4cg0hx91a78k8g 192.168.73.141:2377
-
- [root@localhost ~]# docker swarm join --token SWMTKN-1-5q8e2tevh5lmio5rp06t07houh1c754rtwnrm9vao11i39cff0-7w3icgk110pifhun9xxhie4su 192.168.73.141:2377
- Error response from daemon: manager stopped: can't initialize raft node: rpc error: code = Unknown desc = could not connect to prospective new cluster member using its advertised address: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.73.143:2377: connect: no route to host"
- [pdguser@localhost ~]$ docker node ls
- Error response from daemon: rpc error: code = Unknown desc = The swarm does not have a leader. It's possible that too few managers are online. Make sure more than half of the managers are online.
-
- [pdguser@localhost ~]$ docker swarm leave
- Error response from daemon: You are attempting to leave the swarm on a node that is participating as a manager. The only way to restore a swarm that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to suppress this message.
-
- docker node rm
- [root@localhost ~]# firewall-cmd --zone=public --add-port=2377/tcp --permanent
- success
- [root@localhost ~]# firewall-cmd --query-port=2377/tcp
- no
- [root@localhost ~]# firewall-cmd --reload
- success
- [root@localhost ~]# firewall-cmd --query-port=2377/tcp
mkdir -p /home/nginx/conf
mkdir -p /home/nginx/log
mkdir -p /home/nginx/html
docker run --name nginx -p 9001:80 -d nginx
docker cp nginx:/etc/nginx/nginx.conf /home/nginx/conf/nginx.conf
docker cp nginx:/etc/nginx/conf.d /home/nginx/conf/conf.d
docker cp nginx:/usr/share/nginx/html /home/nginx/html
/home/nginx/conf/nginx.conf
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /var/log/nginx/access.log main;
-
- sendfile on;
- #tcp_nopush on;
-
- keepalive_timeout 65;
-
- #gzip on;
-
-
- # 显示目录
- autoindex on;
- # 显示文件大小
- autoindex_exact_size on;
- # 显示文件时间
- autoindex_localtime on;
- server {
- listen 80;
- server_name localhost;
- # 本地文件路径
- root /usr/share/nginx/data/repo;
- }
- }
docker run \
-p 9002:80 \
--name nginx \
-v /home/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
-v /home/nginx/log:/var/log/nginx \
-v /home/nginx/html:/usr/share/nginx/html \
-v /home/nginx/repo:/usr/share/nginx/data/repo \
-d nginx:latest
docker run with -v /var/run/docker.sock:/var/run/docker.sock
library initialization failed - unable to allocate file descriptor table - out of memory
vi /etc/systemd/system/docker.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --default-ulimit nofile=65535:65535 -H fd://
systemctl daemon-reload
systemctl restart docker
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。