Docker Cheatsheet


Delete all images for i in `docker images | awk 'NR>1{print $1":"$2}'`;do docker rmi $i;done Aliyun docker accelerator /etc/docker/daemon.json {"registry-mirrors": [""]}

when using flannel network plugin, it prompts for missing portmap Fixed by downloading: and extract portmap to /opt/cni/bin/ Obtain node join token $ kubeadm token list | awk 'NR==2{print $1}' Get master hostname $ kubectl get nodes -l -o jsonpath="{.items[*]}" List nodes $ kubectl get nodes -o jsonpath="{.items[*]}" Get master node ip $ kubectl cluster-info | head -1 | grep -oE "[0-9]+\.

Read More…

If you using Dockerfile, you should know about caching for faster builds. Sometimes, you need to rebuild without cache. you can run docker build with --no-cache option that will disable all layer cache. There is problem when you should use some Dockerfile commands like ADD or COPY to copy file form host to container. You need to copy new file to container then rebuild again without change any line of Dockerfile but the new file not was copy to container.

Read More…