How Do You Deploy Several Docker Containers with Nginx and Have Each of Them Work Simultaneously on a Single RedHat Server?

Problem scenario
You want to create several Docker containers each supporting Nginx.  You want to be able to browse to the different instances of Nginx from a web browser.  How do you have multiple Docker containers support Nginx on one RedHat Enterprise Linux host server?

Solution
These directions are geared toward a RHEL host server instance in AWS.

#1 Install Docker.

…

How Do You Troubleshoot the Error “Errors were encountered while processing: docker.io E: Sub-process /usr/bin/dpkg returned an error code (1)”?

Problem scenario
You want to remove Docker from your Ubuntu server.  You tried this command:

sudo apt-get remove docker

But you see this:

“
…
 Active: failed (Result: exit-code) since Sun 2017-08-06 21:59:11 EDT; 11ms ago
     Docs: https://docs.docker.com
  Process: 21981 ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 21981 (code=exited, status=1/FAILURE)
   Memory: 14.0M
  

…

How Do You Troubleshoot This Error “…docker.sock: read:: connection reset by peer”?

Problem scenario
You have Docker installed.  When running “docker ps” you get this error:  “An error occurred trying to connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json: read unix @->/var/run/docker.sock: read: connection reset by peer”

How do you fix this error so you can use Docker?

Solution
Just because Docker was installed does not mean that the kernel of your OS is supported.  Docker may not work despite being installed. 

…

How Do You Set up Nginx to Be a Reverse Proxy That Conveys Inbound Connections to the Web Server with the Fewest Active Connections?

Problem scenario
You want your website to perform well.  By default Nginx’s load balancing system uses the round-robin technique.  You want available yet under-utilized web servers to handle inbound connection requests (aka someone using a web browser to go to a web page).  Individual users can put a disparate load on a given Nginx instance.  Some website users will spend a significant amount of time on a web page.  Others will invoke various application features that will require more resources than others. 

…

How Do You Install Docker on an AWS Instance of Ubuntu?

Problem scenario
You want to install Docker on an AWS instance of Ubuntu.  But you do not know how.  How can you quickly do this?

Solution
Run these two commands:
sudo apt-get -y update
sudo apt -y install docker.io

An alternative set of directions is here.  For a variety of different directions for all different types of Linux,

…

How Do You Deploy Docker to Ubuntu Linux Servers Using Puppet?

Problem scenario
You want to deploy Docker to Ubuntu Linux using Puppet.  How do you write a manifest to install Docker an Ubuntu server?

Solution
This solution demonstrates transferring a file with Puppet.  

1.  Install Puppet master on an Ubuntu Server.  See this link if you want directions.
2.  Install Puppet agent on a different Ubuntu server.  See this 

…

How Do You Deploy Docker to RedHat Linux Servers Using Puppet?

Problem scenario
You want to use Puppet to deploy Docker to a RHEL server in AWS.  How do you do this?

Solution
Warning: This may not work for Puppet versions 5 or higher. It should work for Puppet version 4 or lower. This solution is not a best practice.  It is quick way to deploy a version of Docker made for CentOS to RHEL instances. 

…

How Do You Install Vagrant on an AWS Instance of SUSE?

Problem scenario
You are using a Linux SUSE server in AWS.  You want to install Vagrant. What do you do?

Solution
Run these commands:
cd /tmp
sudo curl https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.rpm > vagrant_1.8.1_x86_64.rpm 

sudo zypper -n install vagrant_1.8.1_x86_64.rpm
To verify the installation, run this command: vagrant version

…

How Do You Install Vagrant on an AWS Instance of RedHat Linux?

Problem scenario
You are using a RHEL (RedHat Enterprise Linux) server in AWS.  You want to install Vagrant. What do you do?

Solution
Assume the root user by issuing this command: sudo su –
Run these commands:
yum -y install wget
cd /tmp
wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.rpm 
yum -y localinstall vagrant_1.8.1_x86_64.rpm

To verify the installation, run this command: vagrant version

Alternative Solution
If you do not want to install wget and curl commands will work for retrieving https locations,

…

How Do You Know If Your Linux Server Can Support a Docker Installation?

Problem scenario
You want to install Docker on Linux.  How do you determine if the VM or physical server with Linux meets the minimum requirements for installing Docker?

Solution
Run this script:

#!/bin/bash
# Written by continualintegration.com
echo “This will test if your Linux server is ready for Docker.”
i=0;

os=$(uname -m | grep -i x)
if [ -z “$os” ];

…