Dockerfile.from_local_tarball 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. FROM python:3.6-jessie
  18. RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset
  19. # Configure environment
  20. ENV LANG=C.UTF-8 \
  21. LC_ALL=C.UTF-8
  22. RUN apt-get update -y
  23. # Install dependencies to fix `curl https support error` and `elaying package configuration warning`
  24. RUN apt-get install -y apt-transport-https apt-utils
  25. # Install superset dependencies
  26. # https://superset.incubator.apache.org/installation.html#os-dependencies
  27. RUN apt-get install -y build-essential libssl-dev \
  28. libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev
  29. # Install nodejs for custom build
  30. # https://superset.incubator.apache.org/installation.html#making-your-own-build
  31. # https://nodejs.org/en/download/package-manager/
  32. RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
  33. && apt-get install -y nodejs
  34. RUN mkdir -p /home/superset
  35. RUN chown superset /home/superset
  36. WORKDIR /home/superset
  37. ARG VERSION
  38. ARG SUPERSET_RELEASE_RC_TARBALL
  39. # Can fetch source from svn or copy tarball from local mounted directory
  40. COPY $SUPERSET_RELEASE_RC_TARBALL ./
  41. RUN tar -xvf *.tar.gz
  42. WORKDIR /home/superset/apache-superset-incubating-$VERSION/superset-frontend
  43. RUN npm ci \
  44. && npm run build \
  45. && rm -rf node_modules
  46. WORKDIR /home/superset/apache-superset-incubating-$VERSION
  47. RUN pip install --upgrade setuptools pip \
  48. && pip install -r requirements.txt \
  49. && pip install --no-cache-dir .
  50. RUN flask fab babel-compile --target superset/translations
  51. ENV PATH=/home/superset/superset/bin:$PATH \
  52. PYTHONPATH=/home/superset/superset/:$PYTHONPATH
  53. COPY from_tarball_entrypoint.sh /entrypoint.sh
  54. ENTRYPOINT ["/entrypoint.sh"]