2023εΉ΄8月22ζ—₯ 星期二

What I Learned Today (08/22/2023): Docker tip!

Installation: πŸ› ️
CA not find error: 🚫
> unset ${!DOCKER*}

Start/Stop docker service: service docker start/stop ⏯️

Build image: docker build -t="test:latest" . πŸ—️
List images: docker images πŸ–Ό️
Run a command in a new container: πŸš€

  • docker run -it -p 8888:8080 -d test:latest

List containers: docker ps πŸ“‹
Connect to running docker container: docker exec -i -t "IMAGE ID" /bin/bash
Stop containers: docker stop $(docker ps -a -q) πŸ›‘

Remove image: docker rmi "IMAGE ID" πŸ—‘️
Remove containers: docker rm $(docker ps -a -q) 🧼
Removing all unused docker images: docker images -q |xargs docker rmi ♻️

Docker hub commands: 🌐
Push docker image:
  • docker tag 515ba39974ef test/icadl:version1
  • docker push test/icadl πŸ“€
Recreate default env πŸ”„
Show docker-machine ip 🌐
  • docker-machine ip
Docker-compose command 🧩

ζ²’ζœ‰η•™θ¨€: