使用Docker涉及一套基本的CLI命令,用于构建镜像、运行和管理容器、以及检查/调试。掌握这些命令是基础的、日常实用的知识。
镜像命令
bash
docker build -t myapp:1.0 . # build an image from a Dockerfile in the current dir
docker images # list local images
docker pull nginx:latest # download an image from a registry
docker push myapp:1.0 # upload an image to a registry
docker rmi myapp:1.0 # remove an image
docker tag myapp:1.0 myapp:latest
