Instead of installing Hadoop and all the other components, you will use a preconfigured Docker image. Hortonworks has a Data Platform Sandbox that already has a container which you can load in Docker. To download it, go to https://hortonworks.com/downloads/#sandbox and select DOWNLOAD FOR DOCKER.
You will also need to install the start_sandox_hdp_version.sh script. This will simplify the launching of the container in Docker. You can download the script from GitHub at: https://gist.github.com/orendain/8d05c5ac0eecf226a6fed24a79e5d71a.
Now you will need to load the image in Docker. The following command will show you how:
docker load -i <image name>
The previous command loads the image into Docker. The image name will be ...