In this lesson, we'll find out the basics of running Docker containers. We'll go over how to download images from Docker Hub, what happens when you stop containers, how to restart a container once it's been stopped, and also how to remove containers.

Run a container:

docker run mongo  // run the container, if container not exists, download from hub

This will output the console log in the command line

Another way to run docker is in the backage:

docker run -d mongo

To stop a container running:

docker stop <container id>

To varify there is not container running:

docker ps

List all the container regarelss running or not:

docker ps -a

Start an container:

docker start <container_id>

Remove an container:

docker rm <container_id>

Notice that container shoud be stop first, then you can remove it.

[Docker] Run, Stop and Remove Docker Containers的更多相关文章

  1. [Docker] Run a command inside Docker container

    For example you are working in a backend project, you have setup Dockerfile: FROM node:10.16.0-stret ...

  2. 【云计算】docker run详解

    Docker学习总结之Run命令介绍 时间 2015-01-21 17:06:00                                               博客园精华区       ...

  3. Docker run 命令的使用方法

    [编者的话]在Docker中,run应该是用户使用最多的命令了,很多读者反馈不是很明白run命令的用法,而且相关的书籍.中文资料中对run命令的描述也不是非常完整,所以DockerOne组织翻译了Do ...

  4. 理解Docker(1):Docker 安装和基础用法

    本系列文章将介绍Docker的有关知识: (1)Docker 安装及基本用法 (2)Docker 镜像 (3)Docker 容器的隔离性 - 使用 Linux namespace 隔离容器的运行环境 ...

  5. Docker——MacOS上安装运行docker

    近几年来,Docker越来越流行,使用场景也越来越广泛.为了能尽快跟上时代步伐.学习并应用到实际工作中,我也开始了Docker之旅. Docker版本 Docker共有两种版本: 社区版(Commun ...

  6. docker(二):CentOS安装docker

    前置条件 1. CentOS 7:要求系统为64位.系统内核版本为 3.10 以上 使用如下命令,查看机器配置 lsb_release -a uname -a 2. 关闭防火墙 systemctl s ...

  7. Docker那些事儿之初识Docker

    公司内部一直在使用Docker进行服务的部署和应用的升级,从开始使用Docker一直到线上的部署以及一些基础服务的开发本人都有参与,而且自己的网站也是在Docker的基础之上进行构建的,想想也需要总结 ...

  8. learning docker steps(9) ----- arm linux docker 安装

    参考:https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1 想要在arm linux上安装docker ...

  9. Docker(三):Docker仓库配置

    1.仓库介绍 仓库(repository)用来集中管理Docker镜像,支持镜像分发和更新. 目前世界上最大最知名的公共仓库是Docker官方的Docker Hub,国内比较知名的有:Docker P ...

随机推荐

  1. 怎样从Cortex-m向STM32移植使用SPI接口协议

    /*************************************************************************************************** ...

  2. NO.1 You must restart adb and Eclipse多种情形分析与解决方式

    一:错误提示 The connection to adb is down, and a severe error has occured. You must restart adb and Eclip ...

  3. TextView-显示自己添加的字体样式

    1.首先要把我们的字体放到相应的目录下 如果我们仅仅是想要验证一个字体,我们可以直接 我们的字体push到 手机 /system/fonts/ 目录下面 2.在代码中进行设置 import andro ...

  4. [LuoguU41039]PION后缀自动机 树链剖分+动态开点线段树

    链接 刚开始看出题人题解都吓蒙掉了,还以为是什么难题,结果就一板子题 思路:对每一个文件名开一棵线段树,然后树剖即可 #include<bits/stdc++.h> #define REP ...

  5. thinkphp事务处理以及无效时的解决方案(整理)

    thinkphp事务处理以及无效时的解决方案(整理) 一.总结 一句话总结:要程序里面支持事务,首先连接的数据库和数据表必须支持事务 mysql 1.InnoDB和MyISAM对事务的支持怎么样? I ...

  6. 带你一分钟理解闭包--js面向对象编程(转载他人)

    什么是闭包? 先看一段代码: function a(){ var n = 0; function inc() { n++; console.log(n); } inc(); inc(); } a(); ...

  7. Flume的Events

    Flume NG传输的数据的基本单位是event,如果是文本文件,通常是一行记录,这也是事务的基本单位.

  8. 过滤选择器及jQuery提供的相关方法

    基本过滤器: <body> <ul> <li>列表1</li> <li class="red">列表2</li&g ...

  9. carousel轮播器

    <div id="myCarousel" class="carousel slide" data-ride="carousel" st ...

  10. POJ 3220 Jessica's Reading Problem

    Jessica's Reading Problem Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12944   Accep ...