Category: Docker

Reset Docker

$ docker rm -f `docker ps -aq` $ docker volume rm -f `docker volume ls -q` $ docker network rm -f `docker network ls -q` $ sudo systemctl stop docker $ sudo umount /var/lib/docker/volumes $ sudo rm -rf /var/lib/docker $ sudo systemctl start docker

Open a TCP Port for Docker management

$ sudo vi /lib/systemd/system/docker.service ## == ## ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 ## == ## $ sudo systemctl daemon-reload $ sudo service docker restart

Install Docker

$ vi install-docker.sh // == // #!/bin/bash . /etc/os-release if [ “$NAME” != “Ubuntu” ]; then echo “Support Ubuntu 16.xx, 18.xx, 20.xx” exit fi # update repo sudo apt-get update # add GPG key sudo apt-get install -y curl curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add – # add Docker repository sudo apt-get install -y […]