builder.dockerfile 1.8 KB

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