Cloudera Docker Container

The Cloudera Docker image is a single-host deployment of the Cloudera open-source distribution, including CDH and Cloudera Manager. You can use this environment to learn Hadoop, try new
ideas, and test and demonstrate your application.

Note: Cloudera does not support CDH cluster deployments using hosts in Docker containers.

Docker is different from other virtual machines that isolate or simulate access to the host’s hardware, so that entire guest operating systems can run on them. Docker uses a Linux
container, which partitions resources of the host operating system; the container has its own view of the filesystem and other resources, but it runs on the same kernel. Docker provides tooling, a
packaging format, and infrastructure around Linux containers and related technologies.

Docker is well supported in several recent Linux distributions. For example, on Ubuntu 14.04, you can install Docker using the following command:

sudo apt-get install docker.io

Importing the Cloudera QuickStart Image

You can import the Docker image by pulling it from the Docker Hub:

docker pull cloudera/quickstart:latest

Running a Cloudera QuickStart Container

To run a container using the image, you must know the name or hash of the image. If you followed the import instructions above, the name is cloudera/quickstart:latest. The hash is also
printed in the terminal when you import, or you can look up the hashes of all imported images with:

Connecting to the Docker Shell

If you do not pass the -d flag to docker run, your terminal automatically attaches to the container.

A container dies when you exit the shell, but you can disconnect and leave the container running by typing Ctrl+p followed by Ctrl+q.

If you disconnect from the shell or passed the -d flag on startup, you can connect to the shell later using the following command:

docker attach [CONTAINER HASH]

You can look up the hashes of running containers using the following command:

docker ps

When attaching to a container, you might need to press Enter to see the shell prompt. To disconnect from the terminal without the container exiting,
type Ctrl+p followed by Ctrl+q.

Networking

To make a port accessible outside the container, pass the -p <port> flag. Docker maps this port to another port on the host system. You can look up
the interface to which it binds and the port number it maps to using the following command:

docker port [CONTAINER HASH] [GUEST PORT]

To interact with the Cloudera QuickStart image from other systems, make sure quickstart.cloudera resolves to the IP address of the machine where the image
is running. You might also want to set up port forwarding so that the port you would normally connect to on a real cluster is mapped to the corresponding port.

When you are mapping ports like this, services are not aware and might provide links or other references to specific ports that are no longer available on your client.

Other Notes

The Cloudera stack is designed to run on a distributed cluster. Pausing and stopping a Docker image is like pausing an entire datacenter—some services might shut down because they seem
to be out of touch with the rest of the cluster.

Cloudera Manager is not started by default. To see options for starting Cloudera Manager, run the following command: