What Are The Different Statuses of Individual Docker Containers?

Question
In Docker what are possible status values of containers?

Answer
Possible statuses include the following:

created, restarting, running, removing, paused, up, exited, or dead

Sources: 1) https://docs.docker.com/engine/reference/commandline/ps/ (for every one except “up”)
2) https://www.thegeekdiary.com/how-to-list-start-stop-delete-docker-containers/ (for “up”)

The docker create command when used with a Docker image ID will produce a new container in the “Created” state.

 » Read more..

How Do You Troubleshoot “no context directory specified, and no dockerfile specified”?

Problem scenario
You run a command like this: docker build -t “ricepaper:contint”

But you receive a message such as this:

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
no context directory specified, and no dockerfile specified

How do you resolve this problem?

Solution
Use a space and a period at the end of the command.

 » Read more..

How Can You Change the cgroups Settings for Docker Containers while Bypassing Docker?

Problem scenario
You want to bypass Docker and configure the cgroups directly. You want new Docker containers to be governed by these customized settings. What should you do?

Solution
You may not want to bypass Docker for your cgroup modifications. You should read about the libcontainers. By default Docker uses libcontainers for granular configuration changes along the lines of modifying cgroups settings.

 » Read more..

Why is Docker Popular with Jenkins?

Question
You have noticed that Docker and Jenkins are regularly used together. Why is this?

Answer
1. The docker build command produces one artifact. Jenkins lends itself to well-defined tasks.

2. The logic and dependencies of the build can usually be completely contained in the Dockerfile (page 20 of Docker Up and Running). Simple lines of text can standardize many aspects of a given build (e.g.,

 » Read more..

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..