Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use Docker in Ubuntu14.04

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to install and use Docker in Ubuntu14.04". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install and use Docker in Ubuntu14.04.

First, the demand of docker

To install docker on ubuntu 14.04 x64, you need to make sure that the version of ubuntu is 64-bit and that the kernel version is greater than 3.10.

1. Check the kernel version of ubuntu

# uname-r 3.13.0-55-generic

2. Update the system to ensure the validity of the package list

# apt-get update

3. If the version of ubuntu is not satisfied, you need to upgrade ubuntu.

# apt-get-y upgrade

Second, install docker

Once the above requirements are met, you can start installing docker. Docker first supported only ubuntu, and then there were centos and other redhat-related distributions. The installation is simple, execute the command:

# apt-get-y install docker.io

Third, create a link

Create a soft link

# ln-sf / usr/bin/docker.io / usr/local/bin/docker # sed-I'$acomplete-f _ docker docker' / etc/bash_completion.d/docker.io

4. Check docker services

To verify the status of the docker service, execute the following command to ensure that the docker service is started.

# service docker.io statusdocker.io start/running, process 14394

To run docker as a daemon, execute the following command: (note that you need to shut down the docker service first)

# docker-d &

5. Docker self-starting service

Install docker as a self-starting service and let it run automatically with the startup of the server, execute the command:

# update-rc.d docker.io defaults

VI. The usage of docker

Here's how to use docker. To see the commands that docker can use, run the docker command on the terminal, which prints a list of all available commands and descriptions of their use.

# docker

7. Download the docker container

Next, we docker command with the pull option to pull an image, that is, to download an image of docker from the software repository of the docker registration server.

The commands used are as follows:

# docker pull ubuntu

The execution of this command will take some time.

Run the docker container

Now you can see that setting up a ubuntu container under bash shell is very simple, as long as you run one line of command.

-I option: let the input and output be carried out in the standard console

-t option: assign a tty

# docker run-I-t ubuntu / bin/bashroot@696d5fd32bba:/#

Therefore, in the output prompt, you can see the standard ubuntu container used.

You can now use bash shell in the docker container of ubuntu. If you want to stop / disconnect, you can use the key combination ctrl-p + ctrl-q, and then return to the previous window.

9. Docker group

Create a docker user group, avoid using root users, and give users of the docker user group the same permissions as root.

# usermod-ag docker ubuntu

You can now log out of the current user and log in using the docker user.

10. Docker testing

Execute the following command to view the output:

Docker@ubuntu-14:/root$ docker run hello-world

The output in the snapshot shows that the docker user is working properly.

11. Docker available containers

The containers available for docker can be found through the search command, and many containers are already available to the community. How to find available docker containers, use the following command to search for centos's docker containers.

# docker search centos so far, I believe you have a better understanding of "how to install and use Docker in Ubuntu14.04". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report