How To Fix a Docker Container That Is Giving An Error ‘exec “bash”: executable file not found in $PATH’

Normally you can enter a Docker container with this command:
docker exec -it <containerIDbash
It is possible you receive an error that says ‘exec “bash”: executable file not found in $PATH’
The root cause could be related to insufficient disk space on the Docker host.  Delete files or otherwise make room (e.g., add disk space).  Then stop the container with this command: docker stop <containerID
Finally,

How Do You Solve a Yum Install/Update Error That Says “Failed to connect to … connection refused”?

Problem:  When trying to use yum commands with a repository on your network, you receive “Failed to connect to x.x.x.x:80; Connection refused” (where x.x.x.x is the IP address of the yum repository server).  What are some possible solutions to this problem?

Potential solutions:
1)  Verify the Linux server with the repository has a valid repository created.  Use “createrepo <directoryToRPMfiles>”

2) 

How To Have The Apache Service Automatically Start When Its Docker Container Is Started

Goal:  To have Apache start when a Docker container starts running do the following (for Docker containers based on RHEL/CentOS/Fedora). 

Prerequisite:  The Docker container was created with the “-p 80:80” flag.  Other port numbers besides 80 will work.  The port numbers do not have to be the same.  They can be any number between 1 and 65535.  If there is no binding of the Docker host’s TCP ports to the container,

How A Docker Container and Its Server Can Share a Directory

Create the Docker Container with this:

docker run -i -v /absolute/path/on/DockerHost:/absolute/path/in/Docker/Container -t repositoryName /bin/bash

where “/absolute/path/on/DockerHost” is the path and directory on the Docker server that will be presented to the Docker container in the location of “/absolute/path/in/Docker/Container.”

The “repositoryName” in the example is found by running this command: docker images
In the results of this command under the left-hand column are the potential repositoryName values.

How To Add a Disk To a RHEL/CentOS/Fedora Server

Run these commands (with sudo in front of them or, less preferably, as the root user):
1) fdisk -l > /tmp/saveOfOutput   # This creates a baseline for step #3 below.

2)  With a physical server:  Turn off the server and connect the physical disk, and turn it back on.
With a virtual server:  Add the disk in vSphere

3)  As root, issue these commands:
fdisk -l #find added device in the output of this command
#If it is not seen,

Concerns About Creating a Docker Container With Optional Flags

Some online Docker literature suggests creating a new Docker container (e.g., the “docker run” command) with these two options:

–net=host –privileged=true

There are some caveats with these flags.  First, if you use them, within your container you can make changes to the Docker server itself.*  For some applications, this defeats Docker’s purpose.  Secondly, if the application you run in Docker becomes compromised, the entire host could be vulnerable to an attack through the Docker container.* 

Five Steps To Creating a Yum Repository Available on Your Network

Q.  How do you create a yum repository server on a network?
Answer:

1.  Put the .rpm files into a directory (e.g., /mnt/coolrepo).
2.  Enter this command: createrepo /mnt/coolrepo
3. 
     a) Install Apache. 
     b)  Configure the httpd.conf file to make the /mnt/coolrepo file presentable over the network. 
           cd /; find . -name    httpd.conf
           vi httpd.conf
           Edit the DocumentRoot stanza to have the value be /mnt/coolrepo
          

Linux (RedHat distribution) Administration Tips

#1  When updating firewalld with the firewall-cmd command, remember that a response of “success” does not mean the changes took effect.  You still have to stop and restart the services.  There are three ways of doing this:  reboot the server, use systemctl stop firewalld; systemctl start firewalld, firewall-cmd –reload

#2  When trying to install an rpm package (e.g., rpm -ivh nameOfNewPackage), you can get this error:
“…existingPackageName is obsoleted by nameOfNewPackage…”

One solution to this is to uninstall the existingPackageName. 

Ansible Can Push Down Files and/or Changes To New Servers With Little Initial Configuration

Some critics say that Ansible does not do enough to warrant its deployment in an enterprise.  The initial deployment to the managed nodes is less than what Puppet and Chef require.  Even minionless deployments of SaltStack require more configuration work than Ansible.  In this post, we want to demonstrate an advantage of adopting Ansible related to the first deployment.  When using passwordless SSH authentication, the great benefit is the lack of a prompt.