Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6537451
  • 博文数量: 1159
  • 博客积分: 12444
  • 博客等级: 上将
  • 技术积分: 12570
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 21:34
文章分类

全部博文(1159)

文章存档

2016年(126)

2015年(350)

2014年(56)

2013年(91)

2012年(182)

2011年(193)

2010年(138)

2009年(23)

分类: 虚拟化

2016-03-04 08:01:04




Docker is a container-based software framework commonly used for automating deployment of applications. Containers are encapsulated, lightweight, and portable application modules.

Pre-Flight Check

  • These instructions are intended for installing Docker on Fedora 23. If you’re using an older version of Fedora or a different operating system, check our tutorials for and .
  • We’ll be logging into a Liquid Web Self Managed Fedora 23 server as root.

Step #1: Install Docker on Fedora 23

As a matter of best practice, we’ll update our packages:

dnf update -y

We’ll install Docker by installing the docker-io package:

dnf -y install docker-io

Once the installation completes, we’ll need to start the Docker daemon:

systemctl start docker

Now we’ll configure Docker to start when the server boots:

systemctl enable docker

That should produce output similar to the following:

[root@host ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

Step #2: Download a Docker Container

To get started using Docker, we’ll download the Fedora Docker image:

docker pull fedora

That should produce output similar to the following:

[root@host ~]# docker pull fedora
Using default tag: latest
Trying to pull repository docker.io/library/fedora ... latest: Pulling from library/fedora
369aca82a5c0: Pull complete
3fc68076e184: Pull complete
Digest: sha256:7d916d5d3ab2d92147e515d3c09cb47a0431e2fff9d550fd9bcc4fed379af9ea
Status: Downloaded newer image for docker.io/fedora:latest

Step #3: Run a Docker Container

Setting up a basic Fedora container with a bash shell requires a single command, “docker”:

docker run -i -t fedora /bin/bash

Breaking down that command:

  • docker run will run a command in a new container
  • -i attaches stdin and stdout
  • -t allocates a tty
  • fedora indicates that we’ll be using the standard Fedora container
  • /bin/bash provides us with our shell

That’s it! You’re now using a bash shell inside of a Fedora Docker container.

To disconnect, or detach, from the shell without exiting, use the escape sequence: Ctrl + p followed by Ctrl + q.

You can easily search for other community containers. Here, we are searching for the keyword “fedora”:

docker search fedora

Step #4: Get More Out of Docker

Learn more about Docker by reviewing the official documentation.
 

Be Sociable, Share!
阅读(1539) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~