Dockercloud-agent error: …Error creating default \”bridge\” network:…


When trying to use the dockercloud-agent with docker you have the following error in the /var/log/dockercloud/agent.log


If you remove the file var/lib/docker/network/files/local-kv.db as suggested here, then if you look again at the log files, it should be a message that the docker daemon has been started:

Clearing unused (dangling) docker volumes


After you start using and building Docker images, there is a case that there is a lot of space used even after deleting images and containers (a few GB maybe).


To clean out the volumes that are no longer used (ie dangling) use the following:

Removing Docker containers that have exited


You would like to clear Docker containers that have been exited and not cleared properly.


Run the following to find out the containers that have exited and remove them.

Error response from daemon: conflict: unable to delete xxx (must be forced) – image is referenced in one or more repositories


Trying to remove some unused docker images that you no longer use with docker rmi image_id you get the following error message:


Use the following to delete multiple images (ie ubuntu):

Mentioned here

Remove terminated/unused docker containers from your system


After playing around with docker containers for some time the terminated/unused ones are still hanging around your system, and prevent you from using a new container with the same name as any of the previous ones with the error:


You can remove all the containers by using the following:

Creating a simple rails docker image for testing in cloud deployment

Trying to deploy a rails application in a cloud provider ie dreamhost, that uses OpenStack these are the steps needed:

  1. Install docker in your development machine and your cloud provider by following the installation instructions from here
  2. Create an account in Docker Hub, that will be needed later on to push your docker image with the application
  3. Pull the official rails docker image to your development environment:
  4. Create a new simple rails application:
  5. Change to the application directory and add a Dockerfile in the root directory containing the following:
  6. Build your new image by using:
  7. Check that your image was build by using:
  8. Start the container with:
  9. Make sure that you can see the initial rails page by using your browser to go to
  10. Push your image to your Docker Hub account by first logging in to it from the command line: , and then when you get ‘Login Succeeded’, push your image to your account:
  11. TBC

Using Elixir with Docker

In order to be able to use Elixir with the help of Docker, so that you can run different containers with different versions, and to have a shared code folder, you could follow the steps below:

  • Install docker in your system. Installation instructions for different systems are here
  • Download the elixir image from the Docker Hub:
  • List the images on your host:
  • Start a specific version of the elixir docker container (ie elixir 1.0.3):
  • Use a shared folder with code between the docker container and your host: where the folders after the -v option are /home/user/Prog (host) and /Prog (docker)
  • Use a port forwarding:

Some useful docker commands

Having started to use docker recently, some of the commands that are needed are a bit difficult to remember. I’m sure that this will change the more that I use it, but as a quick reminder/look up for this initial phase, I’m just going to list some of them here.

List current images:

List currrent running containers:

Saving the state of a container by using the id from above command:

Starting a container with port forwarding:

Sharing a directory from the host system (/home/user/Prog) inside the container (Prog):