2019-03-12-hue-in-docker.md 4.3 KB


title: Hue in Docker author: admin type: post date: 2019-03-12T04:26:43+00:00 url: /hue-in-docker/ ampforwp-amp-on-off:

  • default sf_thumbnail_type:
  • none sf_thumbnail_link_type:
  • link_to_post sf_detail_type:
  • none sf_page_title:
  • 1 sf_page_title_style:
  • standard sf_no_breadcrumbs:
  • 1 sf_page_title_bg:
  • none sf_page_title_text_style:
  • light sf_background_image_size:
  • cover sf_author_info:
  • 1 sf_social_sharing:
  • 1 sf_related_articles:
  • 1 sf_sidebar_config:
  • left-sidebar sf_left_sidebar:
  • Sidebar-2 sf_right_sidebar:
  • Sidebar-1 sf_caption_position:
  • caption-right sf_remove_promo_bar:
  • 1 categories:
  • Administration tags:
  • cloud
  • container
  • docker

Containers offer a modern way to isolate and run applications. This post is the first one of a series showing how to run Hue as a service. Here, we will explore how to build, run and configure a Hue server image with Docker.

For impatient people, the source is available at tools/docker.

Get the docker image

Just pull the latest from the Internet or build it yourself from the Hue repository.

Pull the image from Hue's Docker Hub:

{{< highlight bash >}}

sudo docker pull gethue/hue:latest{{< /highlight >}}

Build the image

Directly from Github source:

{{< highlight bash >}}sudo docker build https://github.com/cloudera/hue.git#master -t hue -f tools/docker/hue/Dockerfile{{< /highlight >}}

Or from a cloned local Hue:

{{< highlight bash >}}sudo docker build . -t hue -f tools/docker/hue/Dockerfile{{< /highlight >}}

Note

  • Feel free to replace -t hue in all the commands by your own docker repository and image tag, e.g. gethue/hue:latest
  • Tag and push the image to the container registry

{{< highlight bash >}}docker build . -t docker-registry.gethue.com/gethue/hue:v4.4

docker push docker-registry.gethue.com/gethue/hue:v4.4{{< /highlight >}}

Run the image

Directly boot the image:

{{< highlight bash >}}docker run -it -p 8888:8888 gethue/hue:latest{{< /highlight >}}

Hue should then be up and running on your default Docker IP on the port 8888, so usually http://127.0.0.1:8888.

Configuration

By default the Hue container is using a default configuration that assumes localhost for all the data services and is backed by a SQLite database in the container (and so everything is reseted at each restart and Hue can't interact with any service).

  • The default ini is used for configuration at the image build time (e.g. which apps to always disable or certain settings like banner customization)
  • In order to configure Hue at the image runtime and for example point to external services, use the simplified hue.ini, edit the values before pointing to it and starting via:

{{< highlight bash >}}docker run -it -p 8888:8888 -v $PWD/tools/docker/hue/hue.ini:/usr/share/hue/desktop/conf/z-hue.ini gethue/hue{{< /highlight >}}

and for advanced properties copy the full configuration ini:

{{< highlight bash >}}cp /desktop/conf.dist/hue.ini .{{< /highlight >}}

{{< highlight bash >}}docker run -it -p 8888:8888 -v $PWD/hue.ini:/usr/share/hue/desktop/conf/z-hue.ini gethue/hue{{< /highlight >}}

 

You can read more about configuring Hue in the documentation.

 

In the next episode, we will see for running this Hue container in Kubernetes!

 

As usual feel free to send feedback to the hue-user list or @gethue or send improvements!