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. 4天html总结

  2. F4IF_FIELD_VALUE_REQUEST 和 F4IF_INT_TABLE_VALUE_REQUEST的不同

    F4IF_FIELD_VALUE_REQUEST 和 F4IF_INT_TABLE_VALUE_REQUEST的不同 F4IF_FIELD_VALUE_REQUEST主要功能是将表里的字段对应的sea ...

  3. 分子量(Molar Mass,ACM/ICPC Seoul 2007,UVa 1586)

    #include<stdio.h>#include<stdlib.h>#include<string.h>int main(){ char s[20]; scanf ...

  4. sublime text 设置

    https://packagecontrol.io/installation#Simple 下载 php 自动补全 点击菜单栏的:Preferences: 选择:Setting-User项: 然后在大 ...

  5. Adding DOM elements to document

    1.JavaScript 添加DOM Element 执行效率比较: 抄自:http://wildbit.com/blog/2006/11/21/javascript-optimization-add ...

  6. Java线程池主线程等待子线程执行完成

    今天讨论一个入门级的话题, 不然没东西更新对不起空间和域名~~ 工作总往往会遇到异步去执行某段逻辑, 然后先处理其他事情, 处理完后再把那段逻辑的处理结果进行汇总的产景, 这时候就需要使用线程了. 一 ...

  7. 数据库 Mysql内容补充一

    mysql时间函数 --获取当前日期 select current_date(); --获取当前时间 select current_time(); --获取当前的日期和时间 select now(); ...

  8. Chapter 2 Open Book——25

    "My name is Edward Cullen," he continued. "I didn't have a chance to introduce myself ...

  9. 第七十七节,CSS3前缀和rem长度单位

    CSS3前缀和rem长度单位 学习要点: 1.CSS3前缀 2.长度单位rem 本章主要探讨HTML5中CSS在发展中实行标准化的一些问题,重点探讨CSS3中新属性前缀问题和新的单位rem. 一 CS ...

  10. 【LeetCode】456. 132 Pattern

    Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that  ...