воскресенье, 24 февраля 2019 г.

Docker installation CentOS 7


yum -y install yum-utils lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y update
yum -y install docker-ce
systemctl enable docker && systemctl start docker && systemctl status docker

docker images

ls -al /var/run/docker.sock
srw-rw---- 1 root docker 0 Feb 22 06:10 /var/run/docker.sock

adding a user a right to work with docker
usermod -aG docker user


All Docker files:
/var/lib/docker


Error on Registry Deployment (IPtables):
 docker run -d -p 5000:5000 -v /root/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/dockerrepo.crt -e REGISTRY_HTTP_TLS_KEY=/cert/dockerrepo.key -v /root/auth:/auth -e REGISTRY_AUTH=htpasswd -e REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd registry:2
0e38a074708e3113cd207fa83d72d90e41374b7643e73e21dbb3cf6d88abd3fa
docker: Error response from daemon: driver failed programming external connectivity on endpoint elegant_hugle (6f83023f4c9f4cf2910b77ddd1c3227e29988e3dfb16f850d4dc7e74c8304638):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 5000 -j DNAT --to-destination 172.17.0.2:5000 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

Solution:
iptables -t filter -F
iptables -t filter -X
systemctl restart docker


Run Ansible in VSCode on Windows 10 (via WSL + Terminal + pip)

Short instruction how to setup VSCode to execute Ansible playbooks directly from Terminal