Docker入坑系列(二)程序員
上一篇咱們爲Docker創造了一個良好的生活環境,這一篇咱們就開始讓Docker活起來。docker
安裝Dockershell
ok,原文地址在這裏。centos
固然,我只是本身翻譯了一下而已- -跟着作了一遍就安裝好啦。bash
# Docker 是一個可以讓應用自動化部署的基礎軟件框架。"容器"是封裝好的,輕量級的便攜式應用模塊 # Docker is a container-based software framework for automating deployment of applications. 「Containers」 are encapsulated, lightweight, and portable application modules. # 預檢 # Pre-Flight Check # 2014年6月 Docker官方正式發行v1.0.0版 # - As of June 2014 Docker has officially released v1.0.0. # 這是如何安裝Docker的使用說明 # - These instructions are intended for installing Docker. # 我將在Liquid Web Core Managed Centos6.5服務器上安裝Docker,而且是以root身份登錄的。 # - I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root. # 添加EPEL資源庫 # Add the EPEL Repository # Docker 是EPEL擴展包的一部分,是RHEL發行的非標準的社區資源庫。 # Docker is part of Extra Packages for Enterprise Linux (EPEL), which is a community repository of non-standard packages for the RHEL distribution. ### 首先,咱們先安裝EPEL資源庫 ### First, we’ll install the EPEL repository: rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm ### 而後,咱們最好更新一下咱們的包 ### Then, as a matter of best practice, we’ll update our packages: yum update -y ### 介紹 如今讓咱們經過docker-io包安裝docker ### Installation ### Now let’s install Docker by installing the docker-io package: yum -y install docker-io ### 等安裝完成後,咱們須要後臺啓動Docker服務 ### Once the installation completes, we’ll need to start the Docker daemon: service docker start ### 最後,咱們能夠配置Docker服務開機自啓。固然也能夠不配置 ### And finally, and optionally, let’s configure Docker to start when the server boots: chkconfig docker on ### 下載一個Docker容器,讓咱們開始使用Docker,下載centos的Docker鏡像 ### Download a Docker Container ### Let’s begin using Docker! Download the centos Docker image: docker pull centos ### 運行一個Docker容器 ### Run a Docker Container ### 如今,構建一個帶有bash shell命令的基本centos容器,咱們只須要運行一個命令:docker run。就會建立一個新的容器。 ### -i:附帶着標準輸入輸出用來交互 ### -t:將分配一個tty,咱們將使用標準的fedora容器 ### Now, to setup a basic centos container with a bash shell, we just run one command. docker run will run a command in a new container, -i attaches stdin and stdout, -t allocates a tty, and we’re using the standard fedora container. docker run -i -t centos /bin/bash ### 如今你正在一個centos Docker容器中使用bash shell ### That’s it! You’re now using a bash shell inside of a centos docker container. ### 如想退出或者離開,請保持按下Ctrl鍵不動並依次按下pq鍵。 ### To disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q. ### 這裏有許多已經能夠用的社區容器,他們能夠經過search來找到,例如找一個centos ### There are many community containers already available, which can be found through a search. In the command below I am searching for the keyword centos: docker search centos
累死了-。-蹩腳英文總算看懂了。因此,來圖。服務器
固然還有程序員的Helloworld。
app