[docker] Python3 clean-up and run as hue user
FROM ubuntu:18.04
LABEL description="Hue SQL Assistant - gethue.com"
-# TODO: run as hue from the start to avoid the long chmod
-
-RUN export PYTHON_VER=python3.6
-
RUN apt-get update -y && apt-get install -y \
python3-pip \
libkrb5-dev \
@@ -24,8 +20,6 @@ RUN apt-get update -y && apt-get install -y \
sudo \
git
-#libmariadb-dev-compat # python3.6-dev #libssl-dev
-
RUN pip3 install --upgrade setuptools
RUN pip3 install virtualenv
@@ -38,29 +32,20 @@ RUN addgroup hue && useradd -r -u 1001 -g hue hue
ADD . /hue
WORKDIR /hue
-RUN chown -R hue /hue
-
-RUN mkdir /hue/build && chown -R hue /hue/build && mkdir /usr/share/hue && chown -R hue /usr/share/hue
+RUN chown -R hue /hue \
+ && mkdir /hue/build \
+ && chown -R hue /hue/build \
+ && mkdir /usr/share/hue \
+ && chown -R hue /usr/share/hue
# Not doing a `make prod`, so manually getting production ini
RUN rm desktop/conf/*
COPY desktop/conf.dist desktop/conf
-#USER hue
-
-#RUN python3.6 -m venv python_env
-
-#SHELL ["/bin/bash", "-c"]
-#RUN source python_env/bin/activate
-
RUN rm -r desktop/core/ext-py
-# RUN pip3 install -r desktop/core/requirements.txt
-
RUN PREFIX=/usr/share PYTHON_VER=python3.6 make install
RUN chown -R hue /usr/share/hue
-#RUN useradd -ms /bin/bash hue && chown -R hue /usr/share/hue
-
# Only keep install dir
# Note: get more minimal image by pulling install dir in a stage 2 image
@@ -75,8 +60,9 @@ RUN ./build/env/bin/pip install \
redis==2.10.6 \
django_redis \
flower \
- git+https://github.com/gethue/PyHive #pyhive \
+ git+https://github.com/gethue/PyHive \
gevent \
+ eventlet \
threadloop # Needed for Jaeger \
thrift-sasl==0.2.1
@@ -84,5 +70,7 @@ RUN ./build/env/bin/pip install \
COPY tools/docker/hue/conf desktop/conf
COPY tools/docker/hue/startup.sh .
+USER hue
+
EXPOSE 8888
CMD ["./startup.sh"]
