Install docker from official site, in windows.

or install docker from repo as official site told, in linux..

after installation, we run by: (windows service, linux daemon started)

docker run hello-world/centos/..

where the names can be found here.

most used args are -it, --rm, --read-only.., -p 80:80, --ip ..

docker ps -sa
# docker --help
# docker command --help

to view history docker machines.

For example, common download size of centos is 80MB, less than 0.1GB, light.

how to access docker lxc?

first ssh to the host of the lxc, then use container's pid to get into lxc, by:

docker inspect <name of container> |grep Pid
nsenter --target $PID --mount --uts --ipc --net --pid

run a docker gerrit:

docker pull gerritforge/gerrit-centos7
docker run -d -p : -p : gerritforge/gerrit-centos7

docker backup:

# back up & export
docker commit -p -m "mark" hash-id # the -p means pause the container while commiting
docker save hashid -o file.tar
# load & run
docker load -i file.tar
docker images
docker start hash-id

restart docker with new conf:

# get containername
docker ps -sa
# create new image from container
docker commit containername imagename
# start new container from newly created image
docker run --name newcontname -p80:80 -p9001:9001 -p9038:9038 -v/Users/zuiyou/bin:/opt/bin -v/Users/zuiyou/GO/data/golang:/data/golang -it imagename /bin/bash
# connect
docker exec -it newcontname

Docker: Usage instruction的更多相关文章

  1. Docker Architecture、Docker Usage

    目录 . 引言 - 为什么要有Docker技术 . Docker简介 . Docker安装.部署.使用 . Docker安全 . Docker底层实现 . Docker网络配置 . Dockerfil ...

  2. docker usage

    docker ps -a 查看物理机上面所有容器信息列表 docker exec -it $docker_id /bin/bash 进入容器以默认帐号 docker exec -it -u root ...

  3. docker usage (2)

    1. docker command docker start postgres docker container ls --all docker image ls --all docker ps -a ...

  4. 这20个Docker Command,有几个是你会的?

    在这之前呢,也写过两篇关于Docker基础入门类的文章 Docker容器技术入门(一) Docker容器技术入门(二) 很多人都感觉这文章这么简单.这么基础,可是别忘记了"万丈高楼平地起&q ...

  5. 《Docker从入门到跑路》之基本用法介绍

    Docker是一种轻量级的虚拟化技术,它具备传统虚拟机无法比拟的优势,它更简易的安装和使用方式.更快的速度.服务集成和开源流程自动化. Docker的安装 安装Docker的基本要素:1.Docker ...

  6. Docker之Compose服务编排

    Compose是Docker的服务编排工具,主要用来构建基于Docker的复杂应用,Compose 通过一个配置文件来管理多个Docker容器,非常适合组合使用多个容器进行开发的场景. 说明:Comp ...

  7. Docker 总结(转载)

    原文链接:http://blog.tankywoo.com/docker/2014/05/08/docker-4-summary.html 查看docker的子命令,直接敲docker或完整的dock ...

  8. Docker Compose to CoreOS

    taken from https://docs.docker.com/compose/install/ the only thing is that /usr is read only, but /o ...

  9. docker命令和后台参数

    Docker官方为了让用户快速了解Docker,提供了一个 交互式教程 ,旨在帮助用户掌握Docker命令行的使用方法. Docker 命令行 下面对Docker的命令清单进行简单的介绍,详细内容在后 ...

随机推荐

  1. LeetCode #3. Longest Substring Without Repeating Characters C#

    Given a string, find the length of the longest substring without repeating characters. Examples: Giv ...

  2. .net 可枚举类型的构建方法

    数组可以使用foreach遍历数组,其实只要实现GetEnumertor方法的类型都可以使用foreach结构遍历数组. 首先看下代码: //笔类 public class Pencil { publ ...

  3. Array对象 识记

    1.Array 创建 new Array(); new Array(size); new Array(element0, element1, ..., elementn); 2.Array 对象属性 ...

  4. iOS 导航栏 不透明

    UINavigationBar.appearance().translucent = false UINavigationBar.appearance().barStyle = UIBarStyle. ...

  5. angular $parse $eval parse VS eval

    $parse  angular中重要指令介绍($eval,$parse和$compile) Advanced Angular: $parse $parse ---------------------- ...

  6. mysql5.7.14 配置

    1. 下载并解压 zip包 2.将解压后的目录 bin  配置到path中 3.修改my-default.ini 文件名为my.ini 4.配置my.ini [mysql] #设置mysql客户端默认 ...

  7. SVN-Attempted to lock an already-locked dir错误

    svn更新时,文件夹被锁死. 解决办法: 右键该文件,在team(版本管理)里面执行"清除"操作后,问题解决了.

  8. 12款免费与开源的NoSQL数据库

    Naresh Kumar是位软件工程师与热情的博主,对于编程与新事物拥有极大的兴趣,非常乐于与其他开发者和程序员分享技术上的研究成果.近日,Naresh撰文谈到了12款知名的免费.开源NoSQL数据库 ...

  9. Hierarchyid(层次结构)数据类型

    实例表结构 CREATE TABLE [dbo].[Emp]( ,), ), [Org] [hierarchyid], ) INSERT INTO Emp(Name,Org) VALUES('吴xx' ...

  10. [妙味JS基础]第七课:运算符、流程控制

    知识点总结 &&(与).||(或).!(非) 与: alert(20 && 20>100) => false alert(20 && 20& ...