Cannot create container for service xxx: invalid mode: /path/to/volume/

Problem

You are trying to use docker-compose to get some services up with docker but you see an error like the following:

Solution

This is more than likely caused by a typo in your yml file, so go back and check carefully for any typos and correct them.

ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket – is it running?

Problem

Using docker-compose up (or build), displays the following error message (even though the same command used to work previously):

Solution

This is quite possible caused by permissions issue, as one of the folders files that docker is trying to use is owned by a different user/group from the one trying to use the docker-compose commands. Try to find the file/folder with the different permissions and change it to your user name and group, or use change the files by using something like:

Find the IP Address of a running Docker container

Problem

You would like to know the IP Address of a running Docker container.

Solution

Use the following to find out the IP Address by replacing the container_name with the actual container name:

minikube kubeconfig error

Problem

Trying to set up minikube you get the following error:

Error setting up kubeconfig: writing kubeconfig: Error writing file : open : no such file or directory

Solution

Unset the KUBECONFIG to solve the issue (unset KUBECONFIG) as described https://pubci.com/2017/01/01/why-not-tryout-kubernetes-locally-via-minikube/

Connection refused when using http monitoring with blackbox_exporter and prometheus

Problem

You are trying to set up http endpoint monitoring with prometheus and blackbox_exporter by specifying something like the following:

but you are getting the error (in prometheus targets) that connection was refused.

Solution

First specify the ip protocol as ip4 if you are not using ip6 like:

And then make sure that you use the container IP address in the replacement field if you have started blackbox_exporter as a docker container (tip taken from here), which you can find by looking for the container IP address (docker inspect blackbox_exporter | grep IPAddress).

So your prometheus configuration should look like the following (different replacement IP):

Getting the slug name for Digital Ocean’s images with doctl

Problem

You would like to get a list of the available images in Digital Ocean, in order to be able to use them in creating your Terraform IAC script.

Solution

By installing the command line tool doctl, (instructions here), according to the documentation (after authenticating) you can run:

But the available images are not listed. In order to be list all the images you have to add the –public option (as described here) :

Use tee command to send output to a file and email

Problem

You would like to send the error output from a command or a script to both an error file and an email.

Solution

By using tee, you could do the following:

Bash script to add environment and date in Symfony appversion.yml file

Problem

You are using CI/CD to deploy a Symfony application that has the appversion.yml configuration file, and you want to add the environment and a timestamp to it after deployment.

Solution

You can achieve this by creating and running a bash script like the following and passing the environment as a variable (ie script_name env) :