文档章节

Docker

LynnZou
 LynnZou
发布于 2017/07/01 14:23
字数 597
阅读 2
收藏 0

1.Docker镜像常用操作 

#Docker 本地镜像
lynn@Utopia:~/data$ sudo docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
redis               latest              83744227b191        3 weeks ago         98.9MB
ubuntu              latest              7b9b13f7b9c0        4 weeks ago         118MB
haproxy             latest              c481d2544260        7 weeks ago         136MB
django              latest              eb40dcf64078        6 months ago        436MB
#拉取centos镜像
lynn@Utopia:~/data$ sudo docker pull centos
Using default tag: latest
latest: Pulling from library/centos
d5e46245fe40: Pull complete 
Digest: sha256:aebf12af704307dfa0079b3babdca8d7e8ff6564696882bcb5d11f1d461f9ee9
Status: Downloaded newer image for centos:latest
#docker已经成功拉取成功
lynn@Utopia:~/data$ sudo docker image ls   
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
redis               latest              83744227b191        3 weeks ago         98.9MB
centos              latest              3bee3060bfc8        3 weeks ago         193MB
ubuntu              latest              7b9b13f7b9c0        4 weeks ago         118MB
haproxy             latest              c481d2544260        7 weeks ago         136MB
django              latest              eb40dcf64078        6 months ago        436MB
#搜索在DockerHub中的CentOS镜像
lynn@Utopia:~/data$ sudo docker search centos
NAME                                   DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
centos                                 The official build of CentOS.                   3435      [OK]       
jdeathe/centos-ssh                     CentOS-6 6.9 x86_64 / CentOS-7 7.3.1611 x8...   74                   [OK]
nimmis/java-centos                     This is docker images of CentOS 7 with dif...   26                   [OK]
gluster/gluster-centos                 Official GlusterFS Image [ CentOS-7 +  Glu...   19                   [OK]
kinogmt/centos-ssh                     CentOS with SSH                                 15                   [OK]
egyptianbman/docker-centos-nginx-php   A simple and highly configurable docker co...   9                    [OK]
torusware/speedus-centos               Always updated official CentOS docker imag...   8                    [OK]
nathonfowlie/centos-jre                Latest CentOS image with the JRE pre-insta...   6                    [OK]
centos/mariadb55-centos7                                                               5                    [OK]
consol/sakuli-centos-xfce              Sakuli JavaScript based end-2-end testing ...   3                    [OK]
darksheer/centos                       Base Centos Image -- Updated hourly             3                    [OK]
harisekhon/centos-java                 Java on CentOS (OpenJDK, tags jre/jdk7-8)       2                    [OK]
harisekhon/centos-scala                Scala + CentOS (OpenJDK tags 2.10-jre7 - 2...   2                    [OK]
timhughes/centos                       Centos with systemd installed and running       1                    [OK]
blacklabelops/centos                   CentOS Base Image! Built and Updates Daily!     1                    [OK]
vorakl/centos                          CentOS7, EPEL, tools. Updated/Tested daily!     1                    [OK]
freenas/centos                         Simple CentOS Linux interactive container       1                    [OK]
januswel/centos                        yum update-ed CentOS image                      0                    [OK]
repositoryjp/centos                    Docker Image for CentOS.                        0                    [OK]
vcatechnology/centos                   A CentOS Image which is updated daily           0                    [OK]
smartentry/centos                      centos with smartentry                          0                    [OK]
kz8s/centos                            Official CentOS plus epel-release               0                    [OK]
vcatechnology/centos-ci                A CentOS image that is used in the VCA Tec...   0                    [OK]
grayzone/centos                        auto build for centos.                          0                    [OK]
grossws/centos                         CentOS 6 and 7 base images with gosu and l...   0                    [OK]

2.Docker容器常用操作

#启动容器
lynn@Utopia:~/data$ sudo docker run -i -t centos /bin/bash  
[root@338a78107666 /]#
#推出容器
[root@338a78107666 /]# exit
exit
#查看正在运行的docker镜像
lynn@Utopia:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
9dc37e5f2883        centos              "/bin/bash"         42 seconds ago      Up 40 seconds                           angry_pasteur
#进入已经运行的容器
lynn@Utopia:~$ sudo docker attach 9dc37e5f2883
[root@9dc37e5f2883 /]# 
#执行运行中的容器命令
lynn@Utopia:~$ sudo docker exec -i -t b93414676e7b ls
anaconda-post.log  dev  home  lib64       media  opt   root  sbin  sys  usr
bin                etc  lib   lost+found  mnt    proc  run   srv   tmp  var
#停止容器
lynn@Utopia:~$ sudo docker stop b93414676e7b
b93414676e7b
#终止容器
lynn@Utopia:~$ sudo docker kill b93414676e7b
b93414676e7b
#启动容器
lynn@Utopia:~$ sudo docker start b93414676e7b
#重启容器
lynn@Utopia:~$ sudo docker restart b93414676e7b
#删除容器
lynn@Utopia:~$ sudo docker rm b93414676e7b

 

© 著作权归作者所有

共有 人打赏支持
LynnZou
粉丝 0
博文 29
码字总数 24973
作品 0
程序员

暂无文章

awk命令用法介绍

10月18日任务 9.6/9.7 awk 1.awk(上)(下) 1.awk 分段操作功能 指定分隔符,并把第一段打印出来,不会改动文件内容 将所有内容打印出来 awk 没有指定分隔符号,则会默认用空格或者空白字符...

hhpuppy
43分钟前
1
0
Spring Cloud Eureka Server高可用之:在线扩容

本文共 1591字,阅读大约需要 6分钟 ! 概述 业务微服务化以后,我们要求服务高可用,于是我们可以部署多个相同的服务实例,并引入负载均衡机制。而微服务注册中心作为微服务化系统的重要单元...

CodeSheep
55分钟前
1
0
内网esxi主机上安装CoreOS虚拟机

CoreOS是一个为专门运行容器而设计的轻量级linux发行版,旨在通过轻量的系统架构和灵活的应用程序部署能力简化数据中心的维护成本和复杂度。它没有包管理工具,运行容器化应用以提供服务;默...

hiwill
今天
1
0
20181018 上课截图

![](https://oscimg.oschina.net/oscnet/49f66c08ab8c59a21a3b98889d961672f30.jpg) ![](https://oscimg.oschina.net/oscnet/a61bc2d618b403650dbd4bf68a671fabecb.jpg)......

小丑鱼00
今天
3
0
WinDbg

参考来自:http://www.cnit.net.cn/?id=225 SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols ctrl + d to open dump_file Microsoft (R) Windows Debugger Version 6.12.0002.633......

xueyuse0012
今天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部