Skip to content

Commit afc891c

Browse files
committed
Refresh the Dockerfile
* Update to Kafka 4.2.0 which is current * Switch to HTTPS Apache Archive from HTTP GaTech clone * Move the Kafka install first in the file to avoid rebuilding that layer when sources change. * Update conda setup to comply with new accept policy * Switch everything to Python 3.14
1 parent bb6382e commit afc891c

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

Dockerfile

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,50 @@
1-
FROM python:3.7.5-slim
1+
# syntax=docker/dockerfile:1
2+
FROM python:3.14-slim
23
USER root
34
SHELL ["/bin/bash", "--login", "-c"]
45

5-
ENV DEBIAN_FRONTEND noninteractive
6-
ENV SCALA_VERSION 2.11
7-
ENV KAFKA_VERSION 2.3.0
8-
ENV KAFKA_HOME /opt/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION"
6+
ARG DEBIAN_FRONTEND="noninteractive"
7+
ENV STREAMZ_ENV="streamz-dev"
8+
ENV SCALA_VERSION="2.13"
9+
ENV KAFKA_VERSION="4.2.0"
10+
ENV KAFKA_HOME="/opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION}"
11+
ARG KAFKA_SRC_TGZ="https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
12+
13+
RUN apt-get update && \
14+
apt-get install --yes --no-install-recommends wget vim && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
# Install Kafka & Expose Port
18+
RUN wget -q "${KAFKA_SRC_TGZ}" -O "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" && \
19+
tar xfz "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" -C /opt && \
20+
rm "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
21+
EXPOSE 9092
922

1023
# Install conda
1124
ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh /miniconda.sh
12-
RUN sh /miniconda.sh -b -p /conda && /conda/bin/conda update -n base conda
25+
RUN sh /miniconda.sh -b -p /conda && \
26+
/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
27+
/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \
28+
/conda/bin/conda update -n base conda
1329
RUN echo "PATH=${PATH}:/conda/bin" >> ~/.bashrc
1430

1531
# Add Streamz source code to the build context
1632
ADD . /streamz/.
1733

1834
# Create the conda environment
19-
RUN conda env create --name streamz-dev -f /streamz/conda/environments/streamz_dev.yml
35+
RUN conda env create --name ${STREAMZ_ENV} -f /streamz/ci/environment-py314.yml
2036
RUN conda init bash
2137

22-
# Ensures subsequent RUN commands do not need the "conda activate streamz_dev" command
23-
RUN echo "conda activate streamz_dev" >> ~/.bashrc
24-
25-
# Build streamz from source
26-
RUN cd /streamz && \
27-
python setup.py install
38+
# Ensures subsequent RUN commands do not need the "conda activate ${STREAMZ_ENV}" command
39+
RUN echo "conda activate ${STREAMZ_ENV}" >> ~/.bashrc
2840

2941
# Install optional dependencies in the conda environment
3042
RUN conda install -c conda-forge jupyterlab \
3143
numpy \
32-
pandas \
33-
wget \
34-
vim
44+
pandas
3545

36-
# Install Kafka
37-
RUN wget -q http://www.gtlib.gatech.edu/pub/apache/kafka/2.3.0/kafka_2.11-2.3.0.tgz -O /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz && \
38-
tar xfz /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -C /opt && \
39-
rm /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz
40-
41-
# Zookeeper & Kafa ports
42-
EXPOSE 2181
43-
EXPOSE 9092
46+
# Build streamz from source
47+
RUN cd /streamz && \
48+
pip install -e . --no-deps
4449

4550
CMD ["/streamz/docker/scripts/entry.sh"]

0 commit comments

Comments
 (0)