dev.spark.Dockerfile
Rama master · réplica de lectura del repositorio original.
FROM python:3.10-bookworm
LABEL description="Mage data management platform"
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Add Debian Bullseye repository
RUN echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list.d/bullseye.list
## System Packages
RUN \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
NODE_MAJOR=20 && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get -y update && \
ACCEPT_EULA=Y apt-get -y install --no-install-recommends \
# Node
nodejs \
# NFS dependencies
nfs-common \
# odbc dependencies
msodbcsql18 \
# Install OpenJDK 11
openjdk-11-jdk \
unixodbc-dev && \
# R
# r-base=4.2.2.20221110-2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
# Remove Debian Bullseye repository
rm /etc/apt/sources.list.d/bullseye.list
## R Packages
# RUN \
# R -e "install.packages('pacman', repos='http://cran.us.r-project.org')" && \
# R -e "install.packages('renv', repos='http://cran.us.r-project.org')"
## Node Packages
RUN npm install --global yarn && yarn global add next
# Install uv for faster package installation
RUN pip3 install --no-cache-dir uv
## Python Packages
RUN \
uv pip install --system --no-cache-dir sparkmagic && \
mkdir ~/.sparkmagic && \
curl https://raw.githubusercontent.com/jupyter-incubator/sparkmagic/master/sparkmagic/example_config.json > ~/.sparkmagic/config.json && \
sed -i 's/localhost:8998/host.docker.internal:9999/g' ~/.sparkmagic/config.json && \
jupyter-kernelspec install --user "$(uv pip show sparkmagic | grep Location | cut -d' ' -f2)/sparkmagic/kernels/pysparkkernel"
# Mage integrations and other related packages
RUN \
uv pip install --system --no-cache-dir "git+https://github.com/wbond/oscrypto.git@d5f3437ed24257895ae1edd9e503cfb352e635a8" && \
uv pip install --system --no-cache-dir "git+https://github.com/mage-ai/singer-python.git#egg=singer-python" && \
uv pip install --system --no-cache-dir "git+https://github.com/mage-ai/dbt-mysql.git#egg=dbt-mysql" && \
uv pip install --system --no-cache-dir "git+https://github.com/mage-ai/dbt-synapse.git#egg=dbt-synapse" && \
uv pip install --system --no-cache-dir pyspark
COPY mage_integrations /tmp/mage_integrations
RUN \
uv pip install --system --no-cache-dir /tmp/mage_integrations && \
rm -rf /tmp/mage_integrations
# Mage Dependencies
COPY requirements.txt /tmp/requirements.txt
RUN \
uv pip install --system --no-cache-dir -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
## Mage Frontend
COPY ./mage_ai /home/src/mage_ai
WORKDIR /home/src/mage_ai/frontend
RUN yarn install && yarn cache clean
ENV MAGE_DATA_DIR=
ENV PYTHONPATH="${PYTHONPATH}:/home/src"
WORKDIR /home/src