Epel Docker

Just do the following steps to launch a multiple-container application. #1 Create your project directory called mywordpress, and change the current directory to it. $ mkdir mywordpress $ cd mywordpress. #2 create a YAML file called docker-compose.yml under your project directory with a text editor, such as: vi or vim. $ vim docker-compose.yml. $ sudo yum install docker-ce docker-ce-cli containerd.io. Manage Docker Services After the installation has completed. $ sudo yum install epel-release. Option 1: Install through yum. In this article, we will learn how to install Dockers. Dockers is a very good tool which runs the application on its own containers. It works like a virtual machine which are more portable and more resource friendly and more dependent on the host OS. Step 2: Add Docker CE repository. There is an open Docker CE repository with rpm packages for Red Hat based Linux systems. We’ll add this repository before we can install Docker CE on Rocky Linux 8 / AlmaLinux OS 8. Install yum-utils which provides yum-config-manager command line tool. Sudo dnf install -y yum-utils.

The docker container was first fully supported by RHEL since the recent CentOS 7.0, which officially runs only on 64-bit architecture platforms with kernel versions 2.6.32-431 and above (i.e>=CentOS 6.5, when running docker, the actual prompt is 3.8.0 and above), please refer to CentOS 6.x kernel upgrade (2.6.32 -)>3.10.58) process records

It is important to note that the installation of CentOS 6.5 is slightly different from that of 7.0. The installation package of docker on CentOS-6 is called docker-io and comes from the Fedora epel library. This warehouse maintains a large number of software not included in the distribution, so you should install EPEL first. The docker of CentOS-7 is directly contained in the Extras repository of the official mirror source (enable=1 enabled under section [extras] of CentOS-Base.repo). The premise is the need to network, the specific installation process is as follows.

1. Disable selinux

2. Install Fedora EPEL

The epel-release-6-8.noarch.rpm package comes with the distribution media and can be installed from rpm.

If a GPG key retrieval failed: [14] Errno Could not open/read file: / / / etc pki/rpm - gpg/RPM - GPG - KEY - EPEL - 6 questions, please install epel online, download RPM - GPG - KEY - EPEL - 6 files.

After this step 1, can be in/etc/yum repos. d/next generation epel repo, epel - testing. repo two files, used for download rpm package from Fedora website.

3. Check the kernel version

Looking at the lowest version of the kernel, it actually works fine and you can upgrade to the 3.10.x version.

You can also run the script check-config.sh to check that the kernel module characters do not match (here are some of missing's, but my docker still starts properly) :

If you are compiling your own kernel, be aware of a few must-have features: DM_THIN_PROVISIONING, IP_NF_TARGET_MASQUERADE, NF_NAT. (there is no corresponding option for AUFS_FS, it is not clear what is going on, but it is not required)

4. Install docker - io

With many documents covered here, the next step is to mount the /cgroup file system. My version of docker is 1.1.2, without modifying the /etc/fstab step.

5. Start the trial run

Abnormal 6.

During my first installation, I unfortunately encountered the following problems:

docker-d startup, or tail-f /var/log/docker view log

Or service docker restart

Unable to enable network bridge NAT: iptables failed: iptables -I POSTROUTING -t nat -s ! -d -j MASQUERADE: iptables v1.4.7: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

The above three exceptions are all due to the lack of kernel modules, which is also the risk of compiling the kernel to upgrade, so you have sciurus's kernel-ml-aufs's rpm package (see the first link for reference).

Docker Compose is a simple Python program that helps in easy deployments of multiple docker containers on a server.

Epel docker

It uses a simple YAML file for service description.

Instead of the long docker run . . . lines, you can just use docker-compose up -dto deploy multiple services at once.

In this tutorial, I'll show you how to install Docker Compose on CentOS server. I'll also show you a quick example of using Docker Compose for deploying an NGINX server with specific configuration.

Installing docker-compose on CentOS

You need Docker installed beforehand. Make sure to install Docker on your CentOS system before installing Docker Compose.

docker-compose isn't packaged on either CentOS's official repositories or docker's rpm repository.

There are two ways to install Docker Compose on Linux:

  • Download the Docker Compose Linux installer files and manually set it up
  • Use PIP to install Docker Compose easily

Personally, I prefer using PIP to install Docker Compose. Since Docker Compose is basically a Python application, it makes sense to use PIP for installing it.

Let's see how to do it.

Install pip3

Install pip3 using the following command:

Install docker-compose using pip3

Use pip to install docker-compose

Update PATH

pip installs docker-compose in ~/.local/bin directory. You'll have to add it to the PATH environment variable so that you can run it from anywhere:

If you're using zsh, change .bashrc to .zshrc.

Once you're done, either use source commandsource ~/.bashrc or reopen the terminal (log out and log back in if it's a server).

Confirm docker-compose is installed using the following command:

Congratulations! You now have docker-compose installed on your CentOS 8 server.

Want to test it out? Follow this simple tutorial and learn how to use Docker Compose.

Deploy a sample nginx server using docker-compose

Nginx is one of the most popular web servers, it's easily deployable via docker.

Let's compare the compose way, and the non-compose way

Deploying Nginx without Docker Compose

You can use run command to easily deploy an nginx server like this:

Here, you've deployed a nginx server, with a container name 'server', using an external network 'net', mounted a volume named 'html', using a custom config file and listening on port 80 on the host, which will automatically restart on failure.

Let's go through the issues here:

You'll have to create the networks and volumes beforehand

Docker won't automatically create the network and volume. You'll have to create them beforehand.

Too many options to write each and every time

There are too many options to write. If it's a more complicated container like a database container or reverse proxy container or a nextcloud container, these options will just grow.

Development environment

What if you're testing your build and don't want to preserve the volume after stopping the container? You'll have to manually remove the volume and network afterwards.

Deploying Nginx with Docker Compose

First, you'll have to create a compose file.

Create a directory named 'nginx-compose' and cd into it:

Create a file named 'docker-compose.yml' and add the following lines

This compose file describes a service named server, that'll deploy a nginx server with exactly the same configurations as we did in the non-compose way. Deploy it using:

docker-compose will look in the current directory for a file named 'docker-compose.yml', parse it, and deploy the services defined in it.

Let's go over the issues of non-compose method now with compose method:

  1. No need to create the networks and volumes beforehand, docker-compose does that for you. You can add external volumes by setting external to true in each volume/network.
  2. Once you've written the .yaml file, no need to write down massive commands anymore. You can copy this file over to any other server that has a recent version of docker-compose installed and it'll run as expected with ease.
  3. You can use docker-compose down -v command to stop and remove not just the containers, but also all the networks and volumes that docker-compose created. This helps in clean up in a development/test environment.

There are many other benefits to using docker-compose over docker run, especially in production, which is out of the scope for today's article.

Epel Install Docker

If you want to see something like that do let me know in the comment section below. Keep an eye out for our docker series for more guides like these.