How Do You Install Spring Framework with Docker?

Problem scenario
You want to deploy the Spring framework with Docker. How do you do this?

Solution
Warning: The last step in this is not a security “recommended practice.” Only follow these directions (with sudo docker run…), if the server is not that important or you are in a very secure network. One published book says you can use “sudo docker …” as long as the server is not in production (page 43 of Docker Up and Running).

 » Read more..

How Do You Use the Docker Pipeline Plugin with Jenkins?

Problem scenario
You want to use the Docker Pipline (with the Jenkins ID of “docker-workflow”). What do you do?

Solution
Prerequisites
Jenkins needs to be installed. If you need assistance, see this posting if you are using a CentOS/RHEL/Fedora server; if you want to install Jenkins on a Debian/Ubuntu server, see this posting.

 » Read more..

How Do You Install Splunk in a Docker Container?

Problem scenario
You want to run Splunk from a Docker container. What do you do?

Solution
Prerequisites
Install Docker. If you need assistance, see this posting.

Procedures
1. Run this command: docker pull splunk/splunk:latest

2. Run this command, but replace “simpleword” with the password that you want the administrator account for the web UI to have:

docker run -d -p 8000:8000 -e ‘SPLUNK_START_ARGS=–accept-license’ -e ‘SPLUNK_PASSWORD=simpleword’ splunk/splunk:latest

3.

 » Read more..

How Do You Set up Nginx as an HTTP Load Balancer for Other Instances of Nginx Running in Docker?

Problem scenario
You have many Docker containers running Nginx.  You want to leverage these instances for users to go to one web site and then be automatically routed to different underlying Nginx instances in Docker containers.  How do you create a single website for web clients to go to with a reverse proxy balancing the load behind-the-scenes?

Solution
Overview
We accomplish an example with four Docker containers each using a free version of Nginx. 

 » Read more..

How Do You Set up Nginx as an HTTP Load Balancer So Client Requests (from Web Browsers) Go to Certain Nginx Servers More Frequently Than Others?

Problem scenario
You have certain Nginx servers with ample resources whereas others have minimal resources.  Based on geographic locations and data center bandwidth locations and costs, you want to assign fractions of the web traffic from client workstations (requests from web browsers) to different Nginx servers more than others.  You do not want round-robin, equal distribution of traffic.  You want customized HTTP load balancing in accord with unequal configurations.  How do you distribute this traffic proportionately according to your desired specifications?

 » Read more..

Where Is The “Welcome to Nginx!” Page Stored in a Docker Container?

Problem scenario
You installed Nginx in a Docker container on a RedHat Linux server.  You go to this container with a web browser and see the default screen.  Where is the default file (on the back-end) that users see from the front-end by default that says “Welcome to nginx!”?

Solution
This is the name and location of the file (assuming the Docker container was created via the public repository):

/usr/share/nginx/html/index.html

 » Read more..

How Do You Troubleshoot a Docker Container Supporting a Web Service That Web Browsers Cannot Seem to Reach?

Problem scenario
You have configured a Docker container with a web service (e.g., Apache web server or Nginx).  You configured the listening, external port to be 80 or a different port number.  You find the web server (either Apache or Nginx) is not working from a web browser.  How do you find what is wrong?

Solution
#1  Use nmap to test the port and IP address.  If you are using Windows,

 » Read more..

What is a Container Breakout?

Question
What is a container breakout?

Answer
A container breakout is an the act of a user or process in a container gaining access to its underlying host server. Containerization is the isolation of processes and/or disk space on a server. A container is isolated from the host server via cgroups and namespaces. Bypassing the cgroup(s) and namespace(s) through intentional acts can be desirable for legitimate systems engineers.

 » Read more..

How Do You Determine the IP Address Assignments of Running Docker Containers?

Problem scenario
You created some Docker containers and assigned them IP addresses. How do you find out what their IP addresses are?

Solution

1. Run this command: docker ps -a # find the container ID of the container you want to know about
2. Run this command but substitute “container_id” with the container ID you found above:
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ container_id

 » Read more..

Why Would a MongoDB Container Work on an Ubuntu Host but Not a SUSE Host?

Problem scenario
You have two Linux servers in AWS, and each one has the same flavor (i.e., same amount of RAM and same number of processors). One is Ubuntu and another is SUSE. These commands will create working containers in Ubuntu:

docker run –name name1-mongo -d mongo
docker run –name name2-mongo -d mongo:2

This command will not create a working container in SUSE:

docker run –name name2-mongo -d mongo:2

The container that is created will never start.

 » Read more..