Docker private server configuration
1. Modify the docker configuration file
/etc/systemd/system/multi-user.target.wants/docker.service
2. Add the docker private server address:
ExecStart=/usr/bin/dockerd-current \ --insecure-registry localhost:8082 \ --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ --default-runtime=docker-runc \ --exec-opt native.cgroupdriver=systemd \ --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ $OPTIONS \ $DOCKER_STORAGE_OPTIONS \ $DOCKER_NETWORK_OPTIONS \ $ADD_REGISTRY \
3. Restart the docker service
[root@bogon docker]# systemctl daemon-reload [root@bogon docker]# systemctl restart docker
4. Upload image
4.1 Login
docker login 127.0.0.1:8081
4.2 hit version
docker tag jlcon/firstdocker localhost:8082/jlcon/firstdocker:latest
4.3 Upload image
docker push localhost:8082/jlcon/firstdocker:latest
4.4 Find mirrors
docker search localhost:8082/jlcon/firstdocker
Enable docker remote access
edit:
vim /etc/sysconfig/docker-network
content:
DOCKER_NETWORK_OPTIONS="-H unix:///var/run/docker.sock -H 0.0.0.0:<端口>"
Restart the docker service:
systemctl daemon-reload systemctl restart docker.service
docker instruction collection
1. Delete the stopped state container
docker rm `docker ps -a |awk '{print $1}' | grep [0-9a-z]`