How Do You Edit Text inside a Docker Container?

Problem scenario
The server you have is a RHEL (RedHat Enterprise Linux) or Ubuntu instance.  You are in a Docker container that you pulled from the internet for Nginx.  Inside this Docker container you cannot use vi because it is not a recognized command.  What do you do to install a text editor in the Docker container?

Solution for non-SUSE Linux
#1  Inside the Docker container,

How Do You Get Nginx in a Docker Container to Log Web Server Activity to a Regular File inside the Container?

Problem scenario
Normally the Nginx web service logs operations (e.g., a user going to a website with a web browser).  By default Nginx Docker containers do not have good logging for web server usage.  You want regular Nginx logging inside the Docker container.  What do you do?

Solution
1.  Go inside the Docker container (e.g., docker exec -it <containerName> bash).  Go to /etc/nginx/

2. 

“No Day Shall Erase You From the Memory of Time”

While this quote from Virgil’s Aeneid is controversial in its 9/11 Museum usage, it is an interesting idea that people may be remembered no matter what happens in the future.

On Patriot Day, also known as the National Day of Service and Rememberance, we have the opportunity to reflect on Americans who have given the full measure of devotion to our country.  

How Do You Find the IP Address Assigned to a Docker Container When It Was Created?

Problem scenario
You have inherited several Docker containers to manage.  They were assigned IP addresses and assigned user-defined networks when they were created.  You do not know what IP addresses that they were given.  You want to know the IP addresses so you can add them to a load balancer.  The external IP address of the Docker host combined with identifying port numbers of the containers can create sockets that are unique. 

How Do You Troubleshoot the Docker Error “User specified IP address is supported only when connecting to networks with user configured subnets.”?

Problem scenario
You are trying to create a Docker image and assign it an IP address with the –ip flag. But you get this error: “/usr/bin/docker-current: Error response from daemon: User specified IP address is supported only when connecting to networks with user configured subnets.”  How do you get your Docker command to work and resolve this problem?

Solution
#1  From the Linux server,

How to Do You Install Apache Tomcat on Ubuntu Linux?

Problem scenario
You want to install Apache Tomcat on Ubuntu Linux.  How do you do this?

Solution
There are three separate ways of doing this.
Possible solution #1: Run this command: sudo apt-get -y install tomcat8
Possible solution #2: See this posting.
Possible solution #3:  Use these directions with one modification:  Step #3 has a URL that needs to be replaced with this URL:  http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.58/bin/apache-tomcat-8.5.58.tar.gz

How Do You Deploy Apache Tomcat in a Docker Instance in an AWS Ubuntu Linux Server?

Problem scenario
You want to deploy Apache Tomcat in a Docker container on an AWS instance of Ubuntu Linux.  How do you do this?

Solution
1.  Install Docker.  See this link if you need assistance.
2.  Start the Docker service with this command:  sudo service docker start
3.  Run these two commands:

docker pull consol/tomcat-8.0
docker run consol/tomcat-8.0

4. 

How Do You Configure Nginx in a Docker Container to Be an HTTP Load Balancer?

Updated on 11/7/17

Problem scenario
You want a computer server (e.g., an AWS instance) to be a reverse proxy (a type of landing page users do not see that acts as a portal).  You want it to relay traffic to other IP addresses.  How do you get a server with Docker to distribute traffic to other IP endpoints?

Solution
Prerequisites
This assumes that Docker has already been installed. 

How Do You Optimize a Website’s Performance That Is Running Nginx as a Load Balancer in a Docker Container?

Problem scenario
You want web page refreshes to happen more quickly for your website when a user clicks “Reload” in her web browser.  The website you manage is powered by Nginx configured as an HTTP load balancer (aka a reverse proxy).  This Nginx configuration is in a Docker container too. The rule you want is that clients’ inbound connection requests from a specific IP address should be relayed to the same Nginx server every time that client reloads the web page in the web browser.