Docker and portainer configuration methods under Linux

Docker and portainer configuration methods under Linux

1. Install and use Docer CE

This article takes CentOS 7 as an example to install the Docker CE version. There are two versions of Docker, the community version CE and the enterprise version EE. The study here takes the CE version as an example.

Two installation methods are available: 1. Install using yum, 2. Automatically install using a script

System requirements

Docker CE supports the 64-bit version of CentOS 7 and requires a kernel version no less than 3.10. CentOS 7 meets the minimum kernel requirements, but due to the relatively low kernel version, some functions (such as the overlay2 storage layer driver) cannot be used, and some functions may be unstable.

Uninstall old versions

The old version of Docker is called docker or docker-engine . Use the following command to uninstall the old version:

$ sudo yum remove docker \
     docker-client \
     docker-client-latest \
     docker-common \
     docker-latest \
     docker-latest-logrotate \
     docker-logrotate \
     docker-selinux \
     docker-engine-selinux \
     docker-engine

1. Install using yum

Install some necessary system tools:

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Add software source information:

$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Update the yum cache:

$ sudo yum makecache fast

Install Docker-ce:

$ sudo yum -y install docker-ce

2. Use scripts to install automatically

Make sure the yum package is updated to the latest version.

$ sudo yum update

In order to simplify the installation process in a test or development environment, Docker officially provides a set of convenient installation scripts, which can be used to install on CentOS systems:

$ curl -fsSL get.docker.com -o get-docker.sh 
$ sudo sh get-docker.sh --mirror Aliyun

After executing this command, the script will automatically prepare everything and install the Edge version of Docker CE on the system.

3. Start Docker

$ sudo systemctl start docker

4. Verify whether the Docker service is started successfully

$ sudo docker run hello-world

The following figure appears to indicate successful startup

2. Use portainer graphical interface tool to manage docker

Portainer is a lightweight Docker environment management UI that can manage docker host and docker swarm. The reason why it is lightweight is that there is only one container for deployment, and it can also be deployed directly using binary programs. Moreover, portainer is cross-platform and can be deployed on both Windows and Linux.

1. Start the portainer container

There are two startup modes to choose from

1. Single-node operation mode

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

-d parameter runs in detach mode
-p maps the container working port to the physical machine port HOST port: container port
-v mounts (maps) the container directory to the corresponding location of the physical machine. Here, the communication method is specified as sock
portainer/portainer is the image name

2. Multi-node: portainner also supports TCP communication

docker run -d -p 9000:9000 portainer/portainer -H tcp://<REMOTE_HOST>:<REMOTE_PORT>

Where REMOTE_HOST is the slave ip, REMOTE_PORT is the slave port

2. Visit

http://host ip:9000

After entering the page, set your username and password

Then select local or remote. Here we use single node local.

After logging in, the following figure is shown

Summarize

The above is the configuration method of Docker and portainer under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Deployment and Chinese translation of the docker visualization tool Portainer
  • Tutorial on using portainer to connect to remote docker
  • The latest super detailed graphic tutorial of installing Kali Linux on virtual machine VMware
  • Kali Linux installation VMware tools installation process and VM installation vmtools button gray
  • How to check the version of Kali Linux system
  • How to switch Python versions in Kali
  • How to install docker and portainer in kali

<<:  How to configure MySQL master-slave synchronization in Ubuntu 16.04

>>:  JS 9 Promise Interview Questions

Recommend

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...

Grid systems in web design

Formation of the grid system In 1692, the newly c...

Vue-Router installation process and principle detailed

Table of contents 1. Front-end routing implementa...

MYSQL METADATA LOCK (MDL LOCK) theory and lock type test

Table of contents MYSQL METADATA LOCK (MDL LOCK) ...

Detailed explanation of mysql backup and recovery

Preface: The previous articles introduced the usa...

Summary of Mysql slow query operations

Mysql slow query explanation The MySQL slow query...

Detailed explanation of HTML programming tags and document structure

The purpose of using HTML to mark up content is t...

Summary of Commonly Used MySQL Commands in Linux Operating System

Here are some common MySQL commands for you: -- S...

Introduction to major browsers and their kernels

Trident core: IE, MaxThon, TT, The World, 360, So...

Summary of methods to include file contents in HTML files

In the forum, netizens often ask, can I read the ...

Two types of tab applications in web design

Nowadays, tabs are widely used in web design, but...

The visual design path of the website should conform to user habits

Cooper talked about the user's visual path, w...

CocosCreator learning modular script

Cocos Creator modular script Cocos Creator allows...