builder.dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. FROM python:2.7.16-slim-buster as sdist
  2. LABEL maintainer="oss@sentry.io"
  3. LABEL org.opencontainers.image.title="Sentry Wheel Builder"
  4. LABEL org.opencontainers.image.description="Python Wheel Builder for Sentry"
  5. LABEL org.opencontainers.image.url="https://sentry.io/"
  6. LABEL org.opencontainers.image.source="https://github.com/getsentry/sentry"
  7. LABEL org.opencontainers.image.vendor="Functional Software, Inc."
  8. LABEL org.opencontainers.image.authors="oss@sentry.io"
  9. # Sane defaults for pip
  10. ENV PIP_NO_CACHE_DIR=off \
  11. PIP_DISABLE_PIP_VERSION_CHECK=1
  12. RUN apt-get update && apt-get install -y --no-install-recommends \
  13. # Needed for fetching stuff
  14. wget \
  15. && rm -rf /var/lib/apt/lists/* \
  16. # Needed to extract final dependencies from the whl
  17. && pip install pkginfo==1.5.0.1
  18. # Get and set up Node for front-end asset building
  19. ENV VOLTA_VERSION=0.8.1 \
  20. VOLTA_HOME=/.volta \
  21. PATH=/.volta/bin:$PATH
  22. RUN wget "https://github.com/volta-cli/volta/releases/download/v$VOLTA_VERSION/volta-$VOLTA_VERSION-linux-openssl-1.1.tar.gz" \
  23. && tar -xzf "volta-$VOLTA_VERSION-linux-openssl-1.1.tar.gz" -C /usr/local/bin \
  24. # Running `volta -v` triggers setting up the shims in VOLTA_HOME (otherwise node won't work)
  25. && volta -v
  26. WORKDIR /js
  27. COPY package.json /js
  28. # Running `node -v` and `yarn -v` triggers Volta to install the versions set in the project
  29. RUN node -v && yarn -v
  30. COPY yarn.lock /js
  31. RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \
  32. && yarn install --frozen-lockfile --production --quiet \
  33. && rm -r "$YARN_CACHE_FOLDER"
  34. WORKDIR /workspace
  35. VOLUME ["/workspace/node_modules", "/workspace/build"]
  36. COPY docker/builder.sh /builder.sh
  37. ENTRYPOINT [ "/builder.sh" ]
  38. ARG SOURCE_COMMIT
  39. ENV SENTRY_BUILD=${SOURCE_COMMIT:-unknown}
  40. LABEL org.opencontainers.image.revision=$SOURCE_COMMIT
  41. LABEL org.opencontainers.image.licenses="https://github.com/getsentry/sentry/blob/${SOURCE_COMMIT:-master}/LICENSE"