docker常用命令整理
基本命令 General Commands - docker -d - start the docker daemon - docker - help - help - docker info - display system-wide infromationDocker Hub 相关- docker login -u [user-name] - Loging into docker - docker push [user-name]/[image-name] - Publish an image to docker hub - docker search [image-name] - Search hub for an image - docker pull [image-name] - Pull an image from a docker hub - docker create [image] = create a container without running - docker create -it [image] - Create an interactive container - docker logout - Log out of a Docker registry - docker system prune - Remove unused images, containers, and networks镜像操作Images- docker build [dockerfile-path] - Create an image form a dckerfile - docker build -t image_name] . - Build an Image from a Dockerfile - docker build -t [image_name] . –no-cache - Build an Image from a Dockerfile without the cache - docker images - List local images - docker history [image] - show history for an image - docker import [url/file] - create an image form a tarball - docker commit [container] [new-image] - create an image from a container - docker tag [image] [image]:[tag] - Tag an image - docker load - name [tar-file] - Load an image from a tar archive - docker save [image] > [tar-file] - Save an image to a tar archive file - docker rmi [image_name] - Delete an Image - docker image prune - Remove all unused images - docker run -itd - network=mynet nginx - run docker image with network 管理容器Containers- docker run - name [container_name][image_name] - Create and run a container from an image, with a custom name - docker run -p [host_port]:[container_port] [image_name] - Create and run a container from an image, with a custom name - docker run -d [image_name] - Run a container in the background(detached mode) - docker run -it [image] - Start an interactive process, such as a shell, in a container - docker run - rm [image] - Run a container and remove it after it stops - docker start|stop [container_name] (or [container-id]) - Start or stop an existing container - docker restart [container] - Stop a running container and start it up again - docker pause [container] - Pause processes in a running container - docker unpause [container] - Resume processes in a running container - docker wait [container] - Block a container until others stop (after which it prints their exit codes) - docker kill [container] - Kill a container by sending a SIGKILL to a running container - docker attach [container] - Attach local standard input, output, and error streams to a running container - docker rm [container_name] - Remove a stopped container - docker rm -f [container-id] - forcefully remove a container, even if it is running - docker exec -it [container_name] sh - Open a shell inside a running container - docker logs -f [container_name] - Fetch and follow the logs of a container - docker inspect [container_name] (or [container_id]) - To inspect a running container - docker ps - To list currently running containers - docker ps - all - List all docker containers (running and stopped) - docker container stats - View resource usage stats - docker rename [container] [new-name] - renaming an existing container - docker logs [container] - View logs for a running container - docker events [container] - View real-time events for a container - docker update [container] - Update the configuration of one or more containers - docker port [container] - View port mapping for a container - docker top [container] - Show running processes in a container - docker stats [container] - View live resource usage statistics for a container - docker diff [container] - Show changes to files or directories on the filesystem - docker cp [file-path] [container-id]:[path] - Copy a local file to a directory in a container - docker cp [container-id]:[path] [host-path] - Copy file from container to the local 容器网络Networks- docker info - list network driver plugins - docker network create -d bridge mynet - Create bridge network - docker network create -d overlay mynet - Create overlay network - docker network ls - List available networks - docker network rm [network] - Remove one or more networks - docker netwrok inspect [network] - Show information on one or more networks - docker network connect [network] [container] - Connect a container to a network - docker network disconnect [network] [container] - Disconnect a container from a network - docker network prune - Remove all the unused docker networks 挂载相关Volumes- docker volume create [name] - Create docker volumes - docker run -itd - volume=[name]:/world nginx - creating a new docker container to attach the docker volume. - docker volume inspect [name] - Show information about volume - docker volume rm [name] - remove docker volumes插件管理Plugin Management- docker plugin enable [plugin] - Enable a Docker plugin - docker plugin disable [plugin] - Disable a Docker plugin - docker plugin inspect [plugin] - View details about a plugin - docker plugin rm [plugin] - Remove a plugin安全Security- docker scan [image] - scan docker image - docker scan - json [image] - display the scan result as a JSON output
太平天国拥有10万女兵,到底有什么作用?她们的最后结局怎样俗话说女子能顶半边天,不过在封建社会,女子的社会地位却十分低下,她们在家从父,嫁人从夫,根本没有什么话语权,夸张一点说,她们就像是男人的附庸。这么看来,古代女子的社会作用,大都是相
球王贝利病情恶化,肾脏和心脏功能出现障碍,将在病房度过圣诞节综合路透社卫报报道,巴西圣保罗阿尔伯特爱因斯坦医院21日宣布,球王贝利的癌症病情持续恶化,肾脏心脏等器官均出现功能障碍。院方称,贝利亟需接受治疗,暂时不能办理出院。贝利的女儿Kel
全球航班取消及延误情况较Covid19前严重草根影响力新视野法兰瓷编译经历了两年多的疫情及边境封锁,人们在今年总算能够再次飞上天空至其他国家开心游玩,但前提是,航班会如期起飞。根据统计数据,2022年航班取消的数量已超过Co
今日,A股情况有变!下周,会迎来强势反弹吗?周五,三大指数又是小区间震荡了,股票表现活跃。行情依旧是分化,新能源消费还是翘翘板效应,资金暂时不肯切换。这个位置,A股肯定是历史底部区域。但是与短线博弈没有关系,不看好就清仓,短
金域医学成为陕西省孕期营养健康管理协作网的公共检测服务平台在怀孕期间,相助准妈妈办好科学规范的滋养好端端军事管制,推向涵养母婴如常,能够更大水准上助力母婴健康成长。陕西省为有助于妊娠期巾帼烟酸现状多为重研讨的后浪推前浪,在2022年4月由
给高龄二胎闺蜜的孕期礼物,我选了健康这是宸妈2022年发布的第106篇原创内容全文共计1334字,大约需要24分钟时间阅读在这个世界上,闺蜜是一个神奇的物种,她总是很神奇的能够秒懂我的心思,陪我笑陪我闹,陪我在这个世
冬季养生,了解这5个养生小常识让你健康过冬!本文来源中华医学会科学普及部冬天比较寒冷,尤其是在北方。冬至这一天在一年当中是阴气最盛的一天,白天时间最短,夜晚时间最长,不过阴长到极限之后,也就不会无限制地去长了。冬至一阳生,冬
陕西长安竞技足球队或将解散根据新华社西安12月23日电(记者姚友明)记者23日从陕西长安竞技足球俱乐部获悉,这支不久前在2022赛季中甲联赛中取得第五名的球队目前仍未解决欠薪问题,或将面临解散。目前我们的球
不明专家再少些,权威解读再多些周梓涵(南京师范大学)还未阳怎么预防?怎么买到合适的药?怎么合理吃药?阳了以后饮食上怎么注意?家里有孕妇老人和孩子到底该信什么?部分民众决定跟着专家走,不料仍然落入谣言的陷阱。一段
释放住房消费潜力多地出台优化措施12月19日,中央财经委员会办公室(以下简称中财办)有关负责人就房地产经济热点问题作出回应。其中指出,在供给端方面,各地区和有关部门要扛起责任,扎实做好保交楼保民生保稳定各项工作继
清科前三季股权投资节奏放缓,但机构对IPO渗透率超七成12月21日,第二十二届中国股权投资年度论坛在深圳南山启幕。论坛上,清科创业创始人董事长首席执行官倪正东发布2022中国股权投资发展报告(以下简称报告)。报告指出,2022年前三季