How Do You Run a Docker Container as a Non-root User?

Problem scenario
You run this command: docker run -it ubuntu bash

docker: Got permission denied while trying to connect to the Docker daemon sockes/create: dial unix /var/run/docker.sock: connect: permission denied.

You do not want to run a Docker container as a privileged user (as a recommended practice).  What should you do?

Solution
Background: “To do builds in the cluster,

How Do You Troubleshoot Connecting to a Docker Registry when You Receive an Error Response from a Daemon about an “i/o timeout”?

Problem scenario
You run a command like this: docker login docker.artifactory

You receive a message like this:
“Error response from daemon: Get https://docker.artifactory:80/v1/users/: dial tcp x.x.x.x:443: i/o timeout”

What should you do?

Solution
Make sure there is no firewall or security group blocking connectivity from the client reaching the Docker registry.  Even if you are running the “docker registry” command from the back-end of the Docker registry server itself,

Why Cannot You Upload Different Docker Images to a Given Docker Repository?

Problem scenario
You have a Docker repository.  You know its name in the Docker registry.  You are having trouble uploading different images to the repository.  What should you do?

Solution
You must use a different Docker repository for each image.  A repository can only hold different versions of the same image.  But only one image can be stored in a repository. 

How Do You Create Your Own Dockerfile to Create a Flask Application?

Problem scenario
You want to use Flask inside a Docker container.  You want to build your own image for the Docker container.  How do you create your own Dockerfile to create a Flask application?

Solution
Prerequisite

Install Docker.  See this posting if you need directions.

Procedures
1.  Create a Dockerfile with the following content (you may want to replace “16.04” with “latest” and if you want to change the location of where the .py file is,

How Do You Create a Docker Image That Has Java 10 in It?

Problem scenario
You want to create Docker containers with Java 9.  How do you create a Docker image to make containers with Java 9 installed in them?

These directions were updated on 12/26/18.

Solution
Prerequisite

This assumes that you have Docker installed. If you need assistance with this, see these postings depending on your operating system:

Debian/Ubuntu
CentOS/Fedora/RHEL
SUSE

Procedures
1. 

How Do You Install Sysdig in an Existing Debian-Based Docker Container?

Problem scenario
You want to monitor Docker containers.  Therefore you want to install Sysdig to try it out.  How do you install Sysdig in a pre-existing Docker container?

Solution
Run these three commands:
apt-get -y update
apt-get -y install curl
curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | bash

What Is a Dockerfile and What Is a Docker Image?

Question / Problem scenario
You know what a Docker container is.  What is a Dockerfile and what is a Docker image?

Answer to What is a Dockerfile?
“Dockerfiles are used to define how a container should look at build time, but they do not manage the container’s ongoing state, and cannot be used to manage the Docker host system.” (Page 5 of Docker Up &

How Do You Troubleshoot the Docker Command Error “not a valid repository/tag”?

Problem scenario
You are trying to run a Docker command, but you get this error:

Error parsing reference: ” continual/integration” is not a valid repository/tag.

What do you do?

Solution
Look to see if you have an extra “\” or space in your Docker run command.  That can cause this problem.