官术网_书友最值得收藏!

Managing containers using Docker CLI

The next step is to actually run a container from the image we pulled from Docker Hub or a private registry in the previous chapter. We are going to use the docker run command to run a container. Before we do that, let's check if we have any containers running already by using the docker ps command:

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAME

Run a container with the docker run command:

$ docker run httpd

The output of the preceding command will be as shown in the following screenshot:

The container is running, but we cannot leave the terminal and continue working in the foreground. And the only way we can escape it is by sending a TERM signal (Ctrl + C) and killing it.

主站蜘蛛池模板: 东安县| 汝州市| 泽州县| 开化县| 惠东县| 乐东| 安化县| 威信县| 兰州市| 陆良县| 保山市| 衡东县| 永城市| 宾川县| 巍山| 武鸣县| 平原县| 南江县| 阿拉善左旗| 闽侯县| 遵化市| 屏边| 安新县| 且末县| 五家渠市| 赤水市| 盐池县| 息烽县| 香港 | 墨江| 海伦市| 育儿| 滦平县| 嘉黎县| 新巴尔虎左旗| 林周县| 西充县| 任丘市| 满洲里市| 普陀区| 丘北县|