nsa安全工具需要联网nsa武器库修复后电脑启动不了吗

博客访问: 399236
博文数量: 102
注册时间:
为了生存,必须不断进步
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: 云计算与虚拟化
环境要求:在Centos7.x上安装docker官方要求内核至少是3.10
1.查看内核和操作系统版本
[root@docker-machine ~]# uname -r
3.10.0-327.el7.x86_64
[root@docker-machine ~]# cat /etc/redhat-release&
CentOS Linux release 7.2.1511 (Core)&
2.yum方式安装——docker安装提供了两种方式,一种是yum,一种是通过scripts安装,这里我们选择前者
[root@docker-machine ~]# yum update
3.添加yum repo
[root@docker-machine ~]# tee /etc/yum.repos.d/docker.repo &&-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
4.安装docker
[root@docker-machine ~]# yum install docker-engine
=================================================================================================
&Package & & & & & & & & & & & & & & & & & & & & Arch & & & & & & & & & & & & & &Version & & & & & & & & & & & & & & & & & & Repository & & & & & & & & & & & & & Size
=================================================================================================
Installing:
&docker-engine & & & & & & & & & & & & & & & & & x86_64 & & & & & & & & & & & & &1.9.1-1.el7.centos & & & & & & & & & & & & &dockerrepo & & & & & & & & & & & & &8.2 M
Installing for dependencies:
&audit-libs-python & & & & & & & & & & & & & & & x86_64 & & & & & & & & & & & & &2.4.1-5.el7 & & & & & & & & & & & & & & & & base & & & & & & & & & & & & & & & & 69 k
&checkpolicy & & & & & & & & & & & & & & & & & & x86_64 & & & & & & & & & & & & &2.1.12-6.el7 & & & & & & & & & & & & & & & &base & & & & & & & & & & & & & & & &247 k
&docker-engine-selinux & & & & & & & & & & & & & noarch & & & & & & & & & & & & &1.9.1-1.el7.centos & & & & & & & & & & & & &dockerrepo & & & & & & & & & & & & & 21 k
&libcgroup & & & & & & & & & & & & & & & & & & & x86_64 & & & & & & & & & & & & &0.41-8.el7 & & & & & & & & & & & & & & & & &base & & & & & & & & & & & & & & & & 64 k
&libsemanage-python & & & & & & & & & & & & & & &x86_64 & & & & & & & & & & & & &2.1.10-18.el7 & & & & & & & & & & & & & & & base & & & & & & & & & & & & & & & & 94 k
&policycoreutils-python & & & & & & & & & & & & &x86_64 & & & & & & & & & & & & &2.2.5-20.el7 & & & & & & & & & & & & & & & &base & & & & & & & & & & & & & & & &435 k
&python-IPy & & & & & & & & & & & & & & & & & & &noarch & & & & & & & & & & & & &0.75-6.el7 & & & & & & & & & & & & & & & & &base & & & & & & & & & & & & & & & & 32 k
&setools-libs & & & & & & & & & & & & & & & & & &x86_64 & & & & & & & & & & & & &3.3.7-46.el7 & & & & & & & & & & & & & & & &base & & & & & & & & & & & & & & & &485 k
Transaction Summary
==================================================================================================
Install &1 Package (+8 Dependent packages)
5.启动docker deamon并将其设置成开机自启动
[root@docker-machine ~]# systemctl start docker
[root@docker-machine ~]# &systemctl enable docker
6.使用docker info命令验证docker安装是否正常
[root@docker-machine ~]# docker info
Containers: 0
Server Version: 1.9.1
Storage Driver: devicemapper
&Data loop file: /var/lib/docker/devicemapper/devicemapper/data
&Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
&Library Version: 1.02.107-RHEL7 ()
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
Total Memory: 1.947 GiB
Name: docker-machine
ID: TX5Y:GFE3:UDOT:2GCL:45MW:D75D:CS37:JWO2:GKNE:7WGX:IG63:JCK2
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
注:这里遇到两个警告,尝试停止默认的firewalld服务,用iptables服务替换,警告依旧。目前还没找到原因,但是不影响后面的使用
7.演示一些docker的基础命令
7.1 查看docker client和docker server的版本
[root@docker-machine ~]# docker version
&Version: & & &1.9.1
&API version: &1.21
&Go version: & go1.4.2
&Git commit: & a34a1d5
&Built: & & & &Fri Nov 20 13:25:01 UTC 2015
&OS/Arch: & & &linux/amd64
&Version: & & &1.9.1
&API version: &1.21
&Go version: & go1.4.2
&Git commit: & a34a1d5
&Built: & & & &Fri Nov 20 13:25:01 UTC 2015
&OS/Arch: & & &linux/amd64
7.2 安装完docker后会多出一个内网ip段(给docker container使用)
[root@docker-machine ~]# ip addr
3: docker0: &NO-CARRIER,BROADCAST,MULTICAST,UP& mtu 1500 qdisc noqueue state DOWN&
& & link/ether 02:42:e6:44:58:df brd ff:ff:ff:ff:ff:ff
& & inet 172.17.0.1/16 scope global docker0
& & & &valid_lft forever preferred_lft forever
7.3&查找docker image
[root@docker-machine ~]# docker search jdk
NAME & & & & & & & & & & & & & & & & & & &DESCRIPTION & & & & & & & & & & & & & & & & & & STARS & & OFFICIAL & AUTOMATED
ingensi/oracle-jdk & & & & & & & & & & & &Official Oracle JDK installed on centos. & & & &17 & & & & & & & & & [OK]
jboss/base-jdk & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & &14 & & & & & & & & & [OK]
7.4 下载docker image——以hello-world镜像为例
[root@docker-machine metadata]# docker pull hello-world
7.5 查看下载的image list
[root@docker-machine metadata]# docker images
REPOSITORY & & & & &TAG & & & & & & & & IMAGE ID & & & & & &CREATED & & & & & & VIRTUAL SIZE
hello-world & & & & latest & & & & & & &0a6ba66e537a & & & &9 weeks ago & & & & 960 B & & & & & --刚下载的image
7.6 查看docker container list&
简单介绍几个与该命令相关的参数:
-a:显示所有的container,不加此参数默认只显示正在运行的container
-l:显示最近创建的container
[root@docker-machine metadata]# docker ps
CONTAINER ID & & & &IMAGE & & & & & & & COMMAND & & & & & & CREATED & & & & & & STATUS & & & & & & &PORTS & & & & & & & NAMES
[root@docker-machine metadata]# docker ps -a
CONTAINER ID & & & &IMAGE & & & & & & & COMMAND & & & & & & CREATED & & & & & & STATUS & & & & & & & & & & &PORTS & & & & & & & NAMES
311f8051c47a & & & &hello-world & & & & "/hello" & & & & & &6 seconds ago & & & Created & & & & & & & & & & & & & & & & & & & & gloomy_williams
e & & & &hello-world & & & & "/hello" & & & & & &53 seconds ago & & &Created & & & & & & & & & & & & & & & & & & & & adoring_stallman
7.7&演示运行一个docker nginx image的过程
--下载docker nginx image
[root@docker-machine metadata]# docker pull nginx
[root@docker-machine metadata]# docker images
REPOSITORY & & & & &TAG & & & & & & & & IMAGE ID & & & & & &CREATED & & & & & & VIRTUAL SIZE
nginx & & & & & & & latest & & & & & & &5328fdfe9b8e & & & &3 days ago & & & & &133.8 MB
--创建对应的静态页面目录以及静态页面
[root@docker-machine metadata]# mkdir -p /var/www/html
[root@docker-machine metadata]# echo "good good study,day day up" & /var/www/html/index.html
--在新的coantainer中运行nginx
简单介绍几个与该命令相关的参数:
--name:给容器指定一个名字
-d:使容器在后台执行
-v:绑定挂载点,将宿主机目录挂载到container中的目录上
-p:端口映射,将宿主主机端口映射到container中的端口
[root@docker-machine metadata]# docker run --name test-nginx2 -d -p 8080:80 -v /var/www/html:/usr/share/nginx/html:ro &nginx
--测试docker nginx image
[root@docker-machine metadata]# curl http://localhost:8080
good good study,day day up
哈哈,成功了,第一次接触docker,感觉很新颖。
阅读(2647) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。Linux中Docker安装后如何使用Docker容器
作者:佚名
字体:[ ] 来源:互联网 时间:01-19 15:13:50
Docker的安装在之前的文章中有介绍过,不少朋友在安装后不知要如何使用Docker容器,下面以图文的形式为大家介绍下如何使用
  在之前的文章中我们有介绍过Docker的安装,不少朋友在安装后不知要如何使用Docker容器,下面小编就给大家介绍下Linux如何使用Docker容器。
  1.启动一个Docker容器
  [root@localhost ~]# docker run -i -t Ubuntu /bin/bash
  Unable to find image &ubuntu& locally
  Pulling repository ubuntu
  04c5d3b7b065: Download complete
  c5a: Download complete
  c7b7c6419568: Download complete
  70c8faa62a44: Download complete
  dc1: Download complete
  Status: Downloaded newer image for ubuntu:latest
  -i:打开容器中的STDIN
  -t:为容器分配一个伪tty终端
  从上面我们可以看出,首先Docker会检查本地是否存在ubuntu镜像,如果在本地没有找到该镜像的话,那么Docker就会去官方的Docker Hub Registry查看Docker Hub中是否有该镜像。Docker一旦找到该镜像,就会下载该镜像并将其保存到本地的宿主机中。
  然后,Docker在文件系统内部用这个镜像创建了一个新的容器。该容器拥有自己的网络、IP地址,以及一个用来可以和宿主机进行通信的桥接网络接口。最后,我们告诉Docker在新容器中要运行什么命令。
  当容器创建完毕之后,Docker就会执行容器中的/bin/bash命令。这时间我们就可以看到容器内的shell
  root@8c342c0c275c:/#
  注:8c342c0c275c代表容器的ID
  2.使用容器
  查看该容器的主机名
  root@8c342c0c275c:/# hostname
  8c342c0c275c
  可以看到,容器的主机名就是该容器的ID
  查看该主机的hosts文件
  root@8c342c0c275c:/# cat /etc/hosts
  172.17.0.2 8c342c0c275c
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  127.0.0.1 localhost
  ::1 localhost ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  可以看到Docker为该容器的IP地址添加了一条主机配置项。
  查看该容器的IP地址
  root@8c342c0c275c:/# ip a
  1: lo: 《LOOPBACK,UP,LOWER_UP》 mtu 65536 qdisc noqueue state UNKNOWN group default
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
  valid_lft forever preferred_lft forever
  inet6 ::1/128 scope host
  valid_lft forever preferred_lft forever
  4: eth0: 《BROADCAST,UP,LOWER_UP》 mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
  inet 172.17.0.2/16 scope global eth0
  valid_lft forever preferred_lft forever
  inet6 fe80::42:acff:fe11:2/64 scope link
  valid_lft forever preferred_lft forever
  查看容器中运行的进程
  root@8c342c0c275c:/# ps -aux
  USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
  root 1 0.0 0.1
? Ss 09:38 0:00 /bin/bash
  root 19 0.0 0.0
? R+ 09:55 0:00 ps -aux
  在容器中安装一个软件包
  root@8c342c0c275c:/# apt-get update && apt-get install vim
trusty InRelease
trusty-updates InRelease
trusty-security InRelease
trusty Release.gpg
trusty-updates Release.gpg [933 B]
trusty-security Release.gpg [933 B]
trusty Release
trusty-updates Release [62.0 kB]
trusty-security Release [62.0 kB]
trusty/main Sources [1335 kB]
trusty/restricted Sources [5335 B]
trusty/universe Sources [7926 kB]
trusty/main amd64 Packages [1743 kB]
trusty/restricted amd64 Packages [16.0 kB]
  Get:10
trusty/universe amd64 Packages [7589 kB]
  Get:11
trusty-updates/main Sources [193 kB]
  Get:12
trusty-updates/restricted Sources [1874 B]
  Get:13
trusty-updates/universe Sources [119 kB]
  Get:14
trusty-updates/main amd64 Packages [493 kB]
  Get:15
trusty-updates/restricted amd64 Packages [14.8 kB]
  Get:16
trusty-updates/universe amd64 Packages [298 kB]
  Get:17
trusty-security/main Sources [70.1 kB]
  Get:18
trusty-security/restricted Sources [1874 B]
  Get:19
trusty-security/universe Sources [19.1 kB]
  Get:20
trusty-security/main amd64 Packages [229 kB]
  Get:21
trusty-security/restricted amd64 Packages [14.8 kB]
  Get:22
trusty-security/universe amd64 Packages [98.1 kB]
  Fetched 20.3 MB in 41s (490 kB/s)
  Reading package lists.。。 Done
  Reading package lists.。。 Done
  Building dependency tree
  Reading state information.。。 Done
  The following extra packages will be installed:
  libgpm2 libpython2.7 libpython2.7-minimal libpython2.7-stdlib vim-runtime
  Suggested packages:
  gpm ctags vim-doc vim-scripts
  The following NEW packages will be installed:
  libgpm2 libpython2.7 libpython2.7-minimal libpython2.7-stdlib vim
  vim-runtime
  0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
  Need to get 9083 kB of archives.
  After this operation, 42.9 MB of additional disk space will be used.
  Do you want to continue? [Y/n] y
  Get:1 /ubuntu/ trusty/main libgpm2 amd64 1.20.4-6.1 [16.5 kB]
  Get:2 /ubuntu/ trusty/main libpython2.7-minimal amd64 2.7.6-8 [307 kB]
  Get:3 /ubuntu/ trusty/main libpython2.7-stdlib amd64 2.7.6-8 [1872 kB]
  Get:4 /ubuntu/ trusty/main libpython2.7 amd64 2.7.6-8 [1044 kB]
  Get:5 /ubuntu/ trusty/main vim-runtime all 2:7.4.052-1ubuntu3 [4888 kB]
  Get:6 /ubuntu/ trusty/main vim amd64 2:7.4.052-1ubuntu3 [956 kB]
  Fetched 9083 kB in 51s (175 kB/s)
  Selecting previously unselected package libgpm2:amd64.
  (Reading database 。。。 11527 files and directories currently installed.)
  Preparing to unpack 。。。/libgpm2_1.20.4-6.1_amd64.deb 。。。
  Unpacking libgpm2:amd64 (1.20.4-6.1) 。。。
  Selecting previously unselected package libpython2.7-minimal:amd64.
  Preparing to unpack 。。。/libpython2.7-minimal_2.7.6-8_amd64.deb 。。。
  Unpacking libpython2.7-minimal:amd64 (2.7.6-8) 。。。
  Selecting previously unselected package libpython2.7-stdlib:amd64.
  Preparing to unpack 。。。/libpython2.7-stdlib_2.7.6-8_amd64.deb 。。。
  Unpacking libpython2.7-stdlib:amd64 (2.7.6-8) 。。。
  Selecting previously unselected package libpython2.7:amd64.
  Preparing to unpack 。。。/libpython2.7_2.7.6-8_amd64.deb 。。。
  Unpacking libpython2.7:amd64 (2.7.6-8) 。。。
  Selecting previously unselected package vim-runtime.
  Preparing to unpack 。。。/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb 。。。
  Adding &diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime&
  Adding &diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime&
  Unpacking vim-runtime (2:7.4.052-1ubuntu3) 。。。
  Selecting previously unselected package vim.
  Preparing to unpack 。。。/vim_2%3a7.4.052-1ubuntu3_amd64.deb 。。。
  Unpacking vim (2:7.4.052-1ubuntu3) 。。。
  Setting up libgpm2:amd64 (1.20.4-6.1) 。。。
  Setting up libpython2.7-minimal:amd64 (2.7.6-8) 。。。
  Setting up libpython2.7-stdlib:amd64 (2.7.6-8) 。。。
  Setting up libpython2.7:amd64 (2.7.6-8) 。。。
  Setting up vim-runtime (2:7.4.052-1ubuntu3) 。。。
  Processing /usr/share/vim/addons/doc
  Setting up vim (2:7.4.052-1ubuntu3) 。。。
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
  Processing triggers for libc-bin (2.19-0ubuntu6.4) 。。。
  退出容器
  root@8c342c0c275c:/# exit
  当我们输入exit后,容器就停止工作了。只有在指定的/bin/bash命令处于运行状态的时间,容器才会相应地处于运行状态。一旦退出容器,/bin/bash命令也就结束了,这时容器也就停止了。
  查看系统中容器的列表
  [root@localhost ~]# docker ps -a
  CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  8c342c0c275c ubuntu:latest &/bin/bash& 26 minutes ago Exited (0) 5 minutes ago sharp_bohr
  8c342c0c275c:代表容器的ID,
  ubuntu:latest :创建容器的镜像
  &/bin/bash&  :容器最后执行的命令
  26 minutes ago :创建时间
  Exited (0) 5 minutes :容器退出的状态
  sharp_bohr     :容器的名称
  Docker中容器的命名
  Docker在创建容器时会自动为容器生成一个随机的名称。那么如果我们想在创建一个容器时指定该容器的名称可以使用如下命令:
  [root@localhost ~]# docker run --name ovcer_the_container -i -t ubuntu /bin/bash
  root@1ce9f640478d:/#
  上面的命令将会创建一个名为ovcer_the_container的容器。对于一个合法的容器的名称来说只可以包括以下字符:小写字母a~z、大写字母A-Z、数字0~9、下划线、圆点、横线。
  上面就是Linux使用Docker容器的方法介绍了,在使用命令创建Docker容器后,就可以使用命令对Docker容器进行命名了。
大家感兴趣的内容
12345678910
最近更新的内容使用Docker中的容器_Linux教程_Linux公社-Linux系统门户网站
你好,游客
使用Docker中的容器
来源:Linux社区&
作者:ovcer
1.启动一个Docker容器
[root@localhost ~]# docker run -i -t
/bin/bashUnable to find image 'ubuntu' locallyPulling repository ubuntu04c5d3b7b065: Download complete c5a: Download complete c7b7c6419568: Download complete 70c8faa62a44: Download complete dc1: Download complete Status: Downloaded newer image for ubuntu:latest
-i:打开容器中的STDIN
-t:为容器分配一个伪tty终端
从上面我们可以看出,首先Docker会检查本地是否存在ubuntu镜像,如果在本地没有找到该镜像的话,那么Docker就会去官方的Docker Hub Registry查看Docker Hub中是否有该镜像。Docker一旦找到该镜像,就会下载该镜像并将其保存到本地的宿主机中。
然后,Docker在文件系统内部用这个镜像创建了一个新的容器。该容器拥有自己的网络、IP地址,以及一个用来可以和宿主机进行通信的桥接网络接口。最后,我们告诉Docker在新容器中要运行什么命令。
当容器创建完毕之后,Docker就会执行容器中的/bin/bash命令。这时间我们就可以看到容器内的shell
root@8c342c0c275c:/#
注:8c342c0c275c代表容器的ID
2.使用容器
查看该容器的主机名
root@8c342c0c275c:/# hostname8c342c0c275c
可以看到,容器的主机名就是该容器的ID
查看该主机的hosts文件root@8c342c0c275c:/# cat /etc/hosts172.17.0.2 8c342c0c275cff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters127.0.0.1 localhost::1 localhost ip6-localhost ip6-loopbackfe00::0 ip6-localnet
可以看到Docker为该容器的IP地址添加了一条主机配置项。
查看该容器的IP地址
root@8c342c0c275c:/# ip a& & & 1: lo: &LOOPBACK,UP,LOWER_UP& mtu 65536 qdisc noqueue state UNKNOWN group default & & link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00& & inet 127.0.0.1/8 scope host lo& & & valid_lft forever preferred_lft forever& & inet6 ::1/128 scope host & & & valid_lft forever preferred_lft forever4: eth0: &BROADCAST,UP,LOWER_UP& mtu 1500 qdisc pfifo_fast state UP group default qlen 1000& & link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff& & inet 172.17.0.2/16 scope global eth0& & & valid_lft forever preferred_lft forever& & inet6 fe80::42:acff:fe11:2/64 scope link & & & valid_lft forever preferred_lft forever
查看容器中运行的进程
root@8c342c0c275c:/# ps -auxUSER& & & PID %CPU %MEM& & VSZ& RSS TTY& & & STAT START& TIME COMMANDroot& & & & 1& 0.0& 0.1& 1 ?& & & & Ss& 09:38& 0:00 /bin/bashroot& & & & 19& 0.0& 0.0& 1 ?& & & & R+& 09:55& 0:00 ps -aux
在容器中安装一个软件包
root@8c342c0c275c:/# apt-get update && apt-get install vimIgn
trusty InRelease& & & Ign
trusty-updates InReleaseIgn
trusty-security InReleaseHit
trusty Release.gpgGet:1
trusty-updates Release.gpg [933 B]Get:2
trusty-security Release.gpg [933 B]Hit
trusty ReleaseGet:3
trusty-updates Release [62.0 kB]Get:4
trusty-security Release [62.0 kB]Get:5
trusty/main Sources [1335 kB]Get:6
trusty/restricted Sources [5335 B]& & & & & & Get:7
trusty/universe Sources [7926 kB]& & & & & & & Get:8
trusty/main amd64 Packages [1743 kB]& & & & & Get:9
trusty/restricted amd64 Packages [16.0 kB]& & Get:10
trusty/universe amd64 Packages [7589 kB]& & & Get:11
trusty-updates/main Sources [193 kB]& & & & & Get:12
trusty-updates/restricted Sources [1874 B]& & Get:13
trusty-updates/universe Sources [119 kB]& & & Get:14
trusty-updates/main amd64 Packages [493 kB]& Get:15
trusty-updates/restricted amd64 Packages [14.8 kB]Get:16
trusty-updates/universe amd64 Packages [298 kB]Get:17
trusty-security/main Sources [70.1 kB]& & & & Get:18
trusty-security/restricted Sources [1874 B]& Get:19
trusty-security/universe Sources [19.1 kB]& & Get:20
trusty-security/main amd64 Packages [229 kB]& Get:21
trusty-security/restricted amd64 Packages [14.8 kB]Get:22
trusty-security/universe amd64 Packages [98.1 kB]Fetched 20.3 MB in 41s (490 kB/s)& & & & & & & & & & & & & & & & & & & & & & & Reading package lists... DoneReading package lists... DoneBuilding dependency tree& & & Reading state information... DoneThe following extra packages will be installed:& libgpm2 libpython2.7 libpython2.7-minimal libpython2.7-stdlib vim-runtimeSuggested packages:& gpm ctags vim-doc vim-scriptsThe following NEW packages will be installed:& libgpm2 libpython2.7 libpython2.7-minimal libpython2.7-stdlib vim& vim-runtime0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.Need to get 9083 kB of archives.After this operation, 42.9 MB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 /ubuntu/ trusty/main libgpm2 amd64 1.20.4-6.1 [16.5 kB]Get:2 /ubuntu/ trusty/main libpython2.7-minimal amd64 2.7.6-8 [307 kB]Get:3 /ubuntu/ trusty/main libpython2.7-stdlib amd64 2.7.6-8 [1872 kB]Get:4 /ubuntu/ trusty/main libpython2.7 amd64 2.7.6-8 [1044 kB]Get:5 /ubuntu/ trusty/main vim-runtime all 2:7.4.052-1ubuntu3 [4888 kB]Get:6 /ubuntu/ trusty/main vim amd64 2:7.4.052-1ubuntu3 [956 kB]Fetched 9083 kB in 51s (175 kB/s)& & & & & & & & & & & & & & & & & & & & & & & Selecting previously unselected package libgpm2:amd64.(Reading database ... 11527 files and directories currently installed.)Preparing to unpack .../libgpm2_1.20.4-6.1_amd64.deb ...Unpacking libgpm2:amd64 (1.20.4-6.1) ...Selecting previously unselected package libpython2.7-minimal:amd64.Preparing to unpack .../libpython2.7-minimal_2.7.6-8_amd64.deb ...Unpacking libpython2.7-minimal:amd64 (2.7.6-8) ...Selecting previously unselected package libpython2.7-stdlib:amd64.Preparing to unpack .../libpython2.7-stdlib_2.7.6-8_amd64.deb ...Unpacking libpython2.7-stdlib:amd64 (2.7.6-8) ...Selecting previously unselected package libpython2.7:amd64.Preparing to unpack .../libpython2.7_2.7.6-8_amd64.deb ...Unpacking libpython2.7:amd64 (2.7.6-8) ...Selecting previously unselected package vim-runtime.Preparing to unpack .../vim-runtime_2%3a7.4.052-1ubuntu3_all.deb ...Adding 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'Unpacking vim-runtime (2:7.4.052-1ubuntu3) ...Selecting previously unselected package vim.Preparing to unpack .../vim_2%3a7.4.052-1ubuntu3_amd64.deb ...Unpacking vim (2:7.4.052-1ubuntu3) ...Setting up libgpm2:amd64 (1.20.4-6.1) ...Setting up libpython2.7-minimal:amd64 (2.7.6-8) ...Setting up libpython2.7-stdlib:amd64 (2.7.6-8) ...Setting up libpython2.7:amd64 (2.7.6-8) ...Setting up vim-runtime (2:7.4.052-1ubuntu3) ...Processing /usr/share/vim/addons/docSetting up vim (2:7.4.052-1ubuntu3) ...update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto modeupdate-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto modeProcessing triggers for libc-bin (2.19-0ubuntu6.4) ...
root@8c342c0c275c:/# exitexit
当我们输入exit后,容器就停止工作了。只有在指定的/bin/bash命令处于运行状态的时间,容器才会相应地处于运行状态。一旦退出容器,/bin/bash命令也就结束了,这时容器也就停止了。
查看系统中容器的列表
[root@localhost ~]# docker ps -aCONTAINER ID& & & & IMAGE& & & & & & & COMMAND& & & & & & CREATED& & & & & & STATUS& & & & & & & & & & PORTS& & & & & & & NAMES8c342c0c275c& & & & ubuntu:latest& & & "/bin/bash"& & & & 26 minutes ago& & & Exited (0) 5 minutes ago& & & & & & & & & & & sharp_bohr&
8c342c0c275c:代表容器的ID,
ubuntu:latest& :创建容器的镜像
"/bin/bash"  :容器最后执行的命令
26 minutes ago& :创建时间
Exited (0) 5 minutes :容器退出的状态
&sharp_bohr&     :容器的名称
Docker中容器的命名
Docker在创建容器时会自动为容器生成一个随机的名称。那么如果我们想在创建一个容器时指定该容器的名称可以使用如下命令:
[root@localhost ~]# docker run --name ovcer_the_container -i -t ubuntu /bin/bashroot@1ce9f640478d:/#
上面的命令将会创建一个名为ovcer_the_container的容器。对于一个合法的容器的名称来说只可以包括以下字符:小写字母a~z、大写字母A-Z、数字0~9、下划线、圆点、横线。
6/7系列安装Docker
Docker的搭建Gitlab CI 全过程详解
Docker安装应用(CentOS 6.5_x64)
在 Docker 中使用 MySQL
在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
Docker安装应用(CentOS 6.5_x64)
Ubuntu 14.04安装Docker&
阿里云CentOS 6.5 模板上安装 Docker
Docker 的详细介绍:Docker 的下载地址:
本文永久更新链接地址:
相关资讯 & & &
& (03月24日)
& (03月10日)
& (04月05日)
& (03月10日)
& (03月10日)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款}

我要回帖

更多关于 nsa武器库修复后电脑启动不了 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信