Skip to content

Commit 4f8cce0

Browse files
Base Superset image on the Red Hat UBI (#103)
* Replace base image with the Red Hat UBI * Convert Superset Dockerfile into multi-stage build
1 parent 968ef99 commit 4f8cce0

File tree

5 files changed

+695
-14
lines changed

5 files changed

+695
-14
lines changed

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@
118118
'versions': [
119119
{
120120
'product': '1.3.2',
121-
'_base_image_tag': '286ba5d37d4e240d01bbefd2307a816829cf512d',
121+
'python': '38',
122122
},
123123
{
124124
'product': '1.4.1',
125-
'_base_image_tag': '26545a26d195b79ab6e838631e86cb0bf20f3ced',
125+
'python': '39',
126126
},
127127
],
128128
},

superset/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [superset-stackable2.0.0] - 2022-04-28
4+
5+
### Changed
6+
7+
- BREAKING: Replace base image with the Red Hat Univeral Base Image. The
8+
location for the Superset configuration file changed to
9+
`/stackable/app/pythonpath` ([#103]).
10+
11+
[#103]: https://github.com/stackabletech/docker-images/pull/103
12+
313
## [superset-stackable1.0.0] - 2022-04-14
414

515
### Removed

superset/Dockerfile

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
1-
# We use the official Superset image here instead of building our own from scratch
2-
# to avoid having to deal with python dependencies and Nexus integration. We might
3-
# change this in the future.
1+
# Build stage
2+
3+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5 as builder
44

55
ARG PRODUCT
6-
ARG _BASE_IMAGE_TAG
7-
ARG RELEASE="1"
6+
ARG PYTHON
7+
8+
COPY superset/constraints-${PRODUCT}.txt /tmp/constraints.txt
9+
10+
RUN microdnf update \
11+
&& microdnf install \
12+
--assumeyes \
13+
cyrus-sasl-devel \
14+
gcc \
15+
gcc-c++ \
16+
libffi-devel \
17+
openldap-devel \
18+
openssl-devel \
19+
python${PYTHON}-devel \
20+
python${PYTHON}-pip \
21+
python${PYTHON}-wheel \
22+
&& microdnf clean all \
23+
&& python3 -m venv /stackable/app \
24+
&& source /stackable/app/bin/activate \
25+
&& pip install \
26+
--no-cache-dir \
27+
--upgrade \
28+
setuptools \
29+
pip \
30+
&& pip install \
31+
--no-cache-dir \
32+
--upgrade \
33+
--constraint /tmp/constraints.txt \
34+
apache-superset==${PRODUCT} \
35+
gevent \
36+
psycopg2-binary \
37+
statsd \
38+
python-ldap
39+
40+
# Final image
841

9-
FROM apache/superset:$_BASE_IMAGE_TAG
42+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
43+
44+
ARG PYTHON
45+
ARG RELEASE=1
1046

1147
LABEL name="Apache Superset" \
1248
maintainer="[email protected]" \
@@ -16,12 +52,40 @@ LABEL name="Apache Superset" \
1652
summary="The Stackable image for Apache Superset." \
1753
description="This image is deployed by the Stackable Operator for Apache Superset."
1854

55+
ENV FLASK_ENV="production" \
56+
HOME="/stackable" \
57+
SUPERSET_PORT="8088"
58+
ENV PATH="${HOME}/app/bin:${PATH}" \
59+
PYTHONPATH="${HOME}/app/pythonpath"
60+
61+
RUN microdnf update \
62+
&& microdnf install \
63+
--assumeyes \
64+
cyrus-sasl \
65+
openldap \
66+
openldap-clients \
67+
openssl-libs \
68+
openssl-pkcs11 \
69+
python${PYTHON} \
70+
shadow-utils \
71+
&& microdnf clean all \
72+
&& groupadd --gid 1000 stackable \
73+
&& useradd --uid 1000 --gid stackable --home-dir ${HOME} stackable
74+
1975
COPY superset/licenses /licenses
76+
COPY --from=builder /stackable ${HOME}
77+
78+
RUN chown --recursive stackable:stackable ${HOME}
2079

21-
USER root
22-
RUN apt update &&\
23-
apt install -y python3-dev libldap2-dev libsasl2-dev libssl-dev &&\
24-
rm -rf /var/lib/apt/lists/*
25-
USER superset
80+
USER stackable
81+
WORKDIR ${HOME}
2682

27-
RUN pip install statsd python-ldap
83+
CMD ["/bin/sh", "-c", \
84+
"gunicorn \
85+
--bind 0.0.0.0:${SUPERSET_PORT} \
86+
--worker-class gthread \
87+
--threads 20 \
88+
--timeout 60 \
89+
--limit-request-line 0 \
90+
--limit-request-field_size 0 \
91+
'superset.app:create_app()'"]

0 commit comments

Comments
 (0)