Using Docker in Fedora 20, I tried to mount a directory. The mount worked correctly but I couldn’t access the file inside the docker container. I got permission denied when trying to read it, or change ownership of it using ‘root’ in the container.

docker run -i -t -v /path/to/volume:/opt rhel:6.5 bin/bash

The permissions show me it’s owned by user and group ID 1000:

#ls -la
drwxrwxr-x. 2 1000 1000 4096 Oct 6 21:46 opt

This is an SELinux permission problem. If you want to grant access to read the file from the Docker container, add this SELinux boolean on the host:

By far the biggest change coming in Openshift is the integration of Docker. Basically the cartridge will be replaced by a Docker container. This is great for application developers, who will have far more control over how they build and package their application for the cloud.

Docker was designed for Openshift. Openshift was already utilising Linux containers to run applications side by side in a multi-tenant way. Docker as introduced a well thought out API, and incremental storage strategy for Linux containers, which make them much easer for developers to use.

So it’s a happy marriage between Openshift and Docker. But how will it work under the covers. A recent presentation by Michal at the Openshift meet up in Brisbane shed some light on that. Keep in mind it’s still early days for Openshift version 3, it’s exciting times ahead. Here’s a preview of what it might look like.

To search for some text, recursively, starting at the current directory is great. But if you want to limit to to only a particular file pattern, you can use grep’s include argument to make it even better.