Install Pouch container engine on Ubuntu 20.04 | 18.04 and CentOS 7
You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose
PouchContainer is Alibaba’s open source container technology. Like Docker, PouchContainer also uses image technology. A container image is a lightweight, independent, executable software package that includes everything needed to run the application: code, runtime, system tools, system libraries, and settings.
PouchContainer has the following functions:
PouchContainer includes a rich container
Mode: With the characteristics and functions of the container, it can be extended to support a wider range of requirements, such as health monitoring, threads, stacks, lock contention, network message statistics and configuration information.
isolation: This technology contains principles of high isolation and security, such as hypervisor-based container technology, lxcfs, directory disk quota, patched Linux kernel, etc.
In large-scale deployments, the bag container uses Dragonfly P2P-based distribution system This greatly improves the delivery speed of containers.
PouchContainer is Kubernetes compatible This way you can easily migrate from a Kubernetes runtime to PouchContainer.
Compared with traditional VM technology, mail bag containers have many advantages. Let’s explore some interesting ones:
1. Resource friendly
Applications running on PouchContainer can minimize its storage usage by using a hierarchical image structure. Compared with traditional VM technology, it also allows incremental image distribution, thereby saving bandwidth consumption.
2. Application-oriented
PouchContainer provides cross-platform and cross-OS application delivery. Powerful application runtime isolation technology makes this possible.
How to install PouchContainer on Ubuntu:
prerequisites:
PouchContainer and LXCFS work together for isolation. LXCFS is a user space file system used to implement containers.
In order for PouchContainer to run on our Ubuntu server, we need to pre-install LXCFS:
sudo apt-get install lxcfs
Install the package that allows aptitude to use the repository via HTTPS:
sudo apt-get install curl apt-transport-https ca-certificates software-properties-common
The next step is to add the official GPG key of PouchContainer:
curl -fsSL http://mirrors.aliyun.com/opsx/pouch/linux/debian/[email protected] | sudo apt-key add -
Add the PouchContainer repository to your Ubuntu server:
sudo add-apt-repository "deb http://mirrors.aliyun.com/opsx/pouch/linux/debian/ pouch stable"
Install the latest version of PouchContainer:
sudo apt-get update
sudo apt-get install pouch
Start and enable PouchContainer
sudo systemctl start pouch
sudo systemctl enable pouch
Now, we have successfully deployed PouchContainer on the Ubuntu server. We will explore some basic PouchContainer commands later in this article.
How to install PouchContainer on CentOS 7
Please note that PouchContainer cannot be installed with Docker on the same instance. If you have a running Docker service and want to install PouchContainer, please uninstall Docker before installing PouchContainer.
The following steps will guide you how to install PouchContainer on an instance running CentOS 7.
1. Install yum utility
sudo yum install -y yum-utils
2. Configure PouchContainer repository to Centos 7 server And update the system:
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/opsx/opsx-centos7.repo
sudo yum update
3. Install PouchContainer
sudo yum install pouch
PouchContainer creates a group “pouch” with no added users. Only the root user has exclusive access to any user group.
4. Start PouchContainer
sudo systemctl start pouch
sudo systemctl enable pouch
To run the pouch command with a non-root user, we need to add the user to the pouch group:
Add user to group
sudo gpasswd -a $USER pouch
PouchContainer container engine usage
PouchContainer has a client/server architecture. In this case, two command lines were issued based on the context:
pouchd: a daemon side binary to run as a server;
pouch: a client side binary to run as a client.
Deploy a simple Nginx application on PouchContainer
As mentioned earlier, it is compatible with docker images.
We will download the nginx image and run a nginx container:
pouch run --name webserver -p 80:80 -d nginx
This command downloads the nginx image from the docker repository and starts a container named “webserver”.
The container has an internal port 80 mapped to port 80 of the server.
To verify that the container is running:
pouch ps -a
The output should look like this:
[[email protected] ~]# pouch ps -a
Name ID Status Created Image Runtime
webserver ad50b8 created 13 seconds ago registry.hub.docker.com/library/nginx:latest runc
Nginx can now be accessed on port 80 of the host:
To run native commands on the container, use Mailbag execution procedures:
pouch exec -it <container> [command]
# Example
pouch exec -it webserver /bin/bash
PouchContainer basic management commands
Other basic usage commands of PouchContainer include:
$ pouch version
Version: 1.3.0
APIVersion: 1.24
Arch: amd64
BuildTime: 2019-06-13T11:25:25+00:00
GitCommit: 1.3.0
GoVersion: go1.10.4
KernelVersion: 3.10.0-1127.el7.x86_64
Os: linux
1. Pull the bag
Usage: pull bag
[[email protected] ~]# pouch pull ubuntu
registry.hub.docker.com/library/ubuntu:latest: resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:bc2f7250f69267c9c6b66d7b6a81a54d3878bb85f1ebb5f951c896d13e6ba537: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:2e70e9c81838224b5311970dbf7ed16802fbfe19e7a70b3cbfa3d7522aa285b4: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:b6a83d81d1f4f942d37e1f17195d9c519969ed3040fc3e444740b884e44dec33: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:d72e567cc804d0b637182ba23f8b9ffe101e753a39bf52cd4db6b89eb089f13b: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:0f3630e5ff08d73b6ec0e22736a5c8d2d666e7b568c16f6a4ffadf8c21b9b1ad: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:9140108b62dc87d9b278bb0d4fd6a3e44c2959646eb966b86531306faa81b09b: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 12.3s total: 27.2 M (2.2 MiB/s)
2. Sack running
Usage: pouch run -it <图像>
This command is used to create a container from an image
[[email protected] ~]# pouch run -it ubuntu
[email protected]:/#
Display list pf locally stored pouch images
pouch images
3. Stop the mail bag container:
First stop the container using the syntax:
pouch stop <container>
# Example
pouch stop webserver
4. Take out the container
To delete a container, use command syntax:
pouch rm <container>
E.g
pouch rm webserver
5. Mail bag submission
usage:
docker commit <conatainer id> <username/imagename>
This command creates a new image of the edited container on the local system
Mailbag daemon configuration
Using the daemon configuration file, the user can set the flag as: server-side command line tool.
Using PouchContainer, users can pass the flag to the daemon in two ways:
- Run the pouch directly using the specified logo, for example
pouchd -c /var/run/containerd.sock
, - Use the daemon configuration file.
The bagged flag can be found in the following locations https://github.com/alibaba/pouch/blob/master/docs/commandline/pouchd.md
Configure the bagged profile:
It is recommended that the user set the daemon flag through the daemon configuration file. The default path of the configuration file is /etc/pouch/config.json
, You can set it to --config-file
Runtime format
If the user wants to add more runtimes to the bag, please add the following:
{
"add-runtime": {
"runc": {
"path": "/usr/local/bin/runc",
"runtimeArgs": [
"--debug"
]
}
}
}
Steps to configure profile
- Install PouchContainer
- Edit the daemon configuration file, for example:
{
"image-proxy": "http://127.0.0.1:65001",
"debug": false
}
3. Start mail bag service:
systemctl start pouch
How to unload the pouch
On Ubuntu:
sudo apt-get purge pouch
On CentOS
sudo yum remove pouch
After running the remove command, the image, container, volume or custom configuration file on the host will not be deleted automatically. To delete all images, containers and volumes, execute the following command:
sudo rm -rf /var/lib/pouch
in conclusion
PouchContainer is one of the best container technologies. Compared with traditional VM technology, it has many advantages and has many features that you really want to explore. We will introduce more features of PouchContainer in other articles on this website. If you have any suggestions for technology or encounter any problems during the installation process, please feel free to leave a message.
You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose