How Do You Solve the Problem of the “docker login” Command Seeming to Work but Hanging for a Long Period of Time and/or Erroring out with “connection refused”?

Problem scenario
“docker login” is challenging you for a username and password.  But after you enter the credentials and press enter, it hangs.  You are not logging into the Docker registry.  What is wrong?

Solution
It may be surprising, but you can be challenged for a username and password when the Docker registry is turned off.  If a firewall blocks a necessary port to the Docker registry or if the Docker registry’s server is off completely,

How Do You Troubleshoot “Permission Denied” When Trying to Use “Docker Login” to Authenticate with a Docker Registry?

Problem scenario
You are trying to log into a Docker registry but you get this message:

“Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.29/auth: dial unix /var/run/docker.sock: connect: permission denied”

You know the credentials are correct.  What is wrong?

Root cause
It could be that your user account is not a member of the “docker” group on the Linux system. 

How Do You Log into the Kubernetes Dashboard?

Problem scenario
When you completed configuring Kubernetes, you were provided with a URL.  But this web page looks minimalistic with no graphics and a white background.  The web UI is not complete or polished and looks like a YAML file.  How do you get to the regular Kubernetes dashboard that looks like this picture? 

Possible Solution #1
1.  From the command prompt you set up Kubernetes with,

How Do You Solve the Docker Error “x509 certificate signed by unknown authority”?

Problem scenario
When you use docker login from a client server and you are challenged for credentials.  But after you enter the password and press enter you get this error:  “Error response from daemon: Get https://: x509: certificate signed by unknown authority”

You do not login to the Docker registry.  How do you get around this problem so you can log into the Docker registry?

Solution
Use one solution 

How Do You Create a Docker Registry in Ubuntu Linux?

Problem scenario
You do not want to rely on internet-available Docker registries.  You want to have your own private Docker registry in your own AWS network.  You want to share Docker images (to build containers) with your team.  You think that installing/deploying a Docker registry will help you.  What do you do to build and configure (or just set up) your own Docker registry with an Ubuntu 16.x server?

Solution
These directions were tested to work with Ubuntu 16.x in AWS and Azure. 

How Do You Troubleshoot an Error with a Certificate When You Are Trying to Configure a Docker Registry?

Problem scenario
You get an error about a certificate not working with your host/server name.  One of the following apply to your situation:

When you use “docker login” you get this message:
“Error response from daemon: x509: certificate is not valid for your server”

OR

When you try to use curl to the Docker registry server you get this error:
curl: (51) SSL: certificate subject name 

How Do You Create Kubernetes Pods with a .YAML File That Use a Docker Image from a Google Container Registry Instead of Docker Hub?

Problem scenario
You have a .yaml configuration file that works with the kubectl command to create a deployment.  You want to change the source image from the hub.docker.com to a Google container source.  How do you configure the .yaml file to obtain the image from a Google container registry instead of Docker Hub?

Your .yaml file has these four lines (among other lines):

  spec:
     

How Do You Enter a Docker Container?

Problem scenario
You have a Docker host that is running Linux (the server with Docker containers).  You want to run commands inside a Docker container.  How do you get into a Docker container?

Solution
Prerequisite
You need to know the container ID of a running container.  To find it run this: docker ps -a

Procedures
Run this command:
docker exec -it <container IDbash

You may want to see this