Docker Handbook (🚧Continuous Update)
1. Install docker and docker-compose on Ubuntu sudo apt-get update sudo apt install docker.io sudo apt install docker-compose 2. Configure rootless user to run docker sudo groupadd docker sudo usermod -aG docker $USER # Linux user can run below to activate the changes newgrp docker docker ps https://docs.docker.com/engine/install/linux-postinstall/ 3. List and delete images docker images docker iamge ls docker rmi <image_id_1> <image_id_2> 4. Check if the specific docker image exists IMAGE_ID=$(docker images | grep 'portainer/base' | awk '{ print $3 }') if [[ -n ${IMAGE_ID} ]]; then docker rm -f ${IMAGE_ID}; fi 5. Login remote registry # Default is dockerhub. username is docker hub id docker login # Login the specific registry docker login registry.private.com 6. Build image from Dockerfile docker build -t <user>/<repo>:<tag> -f Dockerfile . 7. Push the local image to remote registry docker image push <user>/<repo>:<tag> # Push to the private registry docker push registry.private.com/<repo>:<tag> 8. Add and view the docker volume # add volume docker volume create <volume_name> # view volume docker volume ls sudo ls /var/lib/docker/volumes 9. Check the volume detail docker volume inspect <volume_name> 10. Test docker container service connection with curl ping the http service ...