Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic operations of Docker

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the basic operations of Docker". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the basic operations of Docker"?

Docker pull NAME [: TAG] docker imagesdocker inspect IMAGE_ID gets the details of the image docker tag REPOSITORY:TAG can add a new label for the local image docker search command searches for shared image parameters in the remote repository:-- automated=false displays only automatically created images-- no-trunc=false output information does not truncate display-s -- starts=0 specifies that only mirrors rated above the specified star docker rmi image [image...] docker ps-a command can be seen that all containers that exist on this machine are created based on existing mirrored containers using the command docker commit [OPTIONS] CONTAINER [REPOSITORY [: TAG] command argument:-an OPTIONS author = "" author information-m -- message "" submission information-pausing the container when submitting true pmam talk pause.Import based on local template using cat image package | docker import-REPOSITORY:TAG command command docker save-o compressed package save name REPOSITORY:TAG can save the image. Command docker load-- input compressed package save name or docker load

< 压缩包保存名可从导出的文件中重新载入镜像。可以使用docker push NAME[:TAG]上传镜像到仓库,默认上传到DockerHub官方仓库第一次使用必须要先登录。docker login可以使用docker create命令来新建一个容器,新建的容器处于停止状态,可以使用docker start CONTAINER_ID命令来启动它。启动容器有两种方式:基于镜像新建一个容器并启动;将在终止状态的容器重新启动。所需的命令主要为docker run,等价于先执行docker create,再执行docker start启动一个bash终端,允许用户进行交互,-t参数让Docker分配一个伪终端并绑定到容器的标准输入上,-i参数则让容器的标准输入保持打开,-d参数会让Docker容器在后台以守护形式运行,获取容器输出信息,可通过docker logs命令 docker run -t -i ubuntu:14.04 /bin/bash docker run -tid ubuntu:14.04 docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello word; sleep 1; done"可以用docker stop [-t|--time [=10]]来终止一个运行中的容器docker ps -a -q查看处于终止状态的容器的ID信息docker start启动一个处于终止状态的容器docker restart将一个运行态的容器终止然后再重新启动它docker attach当多个窗口同时attach到同一个容器时,所有窗口都会同步显示。当某个窗口因命令阻塞时,其他窗口也无法执行操作 docker attach elegant_ridedocker exec官方推荐使用 docker exec -ti a0bb97c292d1 /bin/bashdocker rm CONTAINER_IDdocker rm [OPTIONS] CONTAINER [CONTAINER...]命令删除处于终止状态的容器 参数: -f,--force=false 强行终止并删除一个运行中的容器 -l,--link=false 删除容器的连接,但保留容器 -v,--volumes=false 删除容器挂载的数据卷docker export CONTAINER命令 导出容器是指导出一个已经创建好的容器到一个文件,不管此时这个容器是否处于运行状态 docker export 547 >

Files exported by test.tar can be imported using the docker import command to become a mirror cat test.tar | docker import-test/ubuntu:v1.0 automatic creation (Automated Builds) function is very convenient for frequently upgrading in-scene programs. Users specify through Docker Hub to track a project on a target website (currently supports GitHub or BitBucket), once the project finds a new submission. Then automatically perform the steps of creating the configuration automatically: 1. Create and log in to the Docker Hub and the target site, and connect the account to the Docker Hub in the target site. 2, configure an automatic creation in Docker Hub; 3, select a target site in the project (need to contain Dockerfile) and branches; 4, specify the location of the Dockerfile, and submit to create; 5, you can then track the status of each creation in the "automatic creation" page of Docker Hub. After installing Docker, you can easily build a local private repository environment through the official registry image. Start downloading a registry container and create a local private repository service. By default, the repository is created in the container's / tmp/registry directory, and the image file can be stored locally on the specified path with the-v parameter. At this time, a private warehouse service will be started locally, and the listening port is 5000 docker run-d-p 5000 docker run / opt/data/registry:/tmp/registry registry https://www.jianshu.com/p/f272726db9c5. I believe you have a better understanding of "what are the basic operations of Docker". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report