Skip to content

Commit

Permalink
Update Dockerfile w/ new Hunter integration
Browse files Browse the repository at this point in the history
- Moving to 3.11.8 Python Docker image
- Updating our Dockerfile with the new integration
- Pining our Hunter work to v0.5.0

Signed-off-by: Joe Talerico <[email protected]>
  • Loading branch information
Joe Talerico committed Feb 9, 2024
1 parent c598081 commit 4b88c84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
31 changes: 6 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
FROM python:3.12.1-slim-bullseye
FROM python:3.11.8-slim-bookworm
# So that STDOUT/STDERR is printed
ENV PYTHONUNBUFFERED="1"

# We create the default user and group to run unprivileged
ENV HUNTER_HOME /srv/hunter
WORKDIR ${HUNTER_HOME}

RUN groupadd --gid 8192 hunter && \
useradd --uid 8192 --shell /bin/false --create-home --no-log-init --gid hunter hunter && \
chown hunter:hunter ${HUNTER_HOME}

# First let's just get things updated.
# Install System dependencies
RUN apt-get update --assume-yes && \
Expand All @@ -24,26 +16,15 @@ RUN apt-get update --assume-yes && \
virtualenv \
&& rm -rf /var/lib/apt/lists/*

# Get poetry package
RUN curl -sSL https://install.python-poetry.org | python3 -
# Adding poetry to PATH
ENV PATH="/root/.local/bin/:$PATH"

RUN git clone https://github.com/datastax-labs/hunter.git ${HUNTER_HOME}

ENV PATH="${HUNTER_HOME}/bin:$PATH"
ENV PATH="~/bin:$PATH"

RUN --mount=type=ssh \
virtualenv --python python venv && \
. venv/bin/activate && \
poetry install -v && \
mkdir -p bin && \
ln -s ../venv/bin/hunter ${HUNTER_HOME}/bin
RUN python -m venv venv

COPY --chown=hunter:hunter . orion
ADD . orion/

RUN . venv/bin/activate && \
cd orion \
pip install setuptools && \
pip install -r requirements.txt && \
python setup.py install && \
ln -s ../venv/bin/orion ${HUNTER_HOME}/bin
ln -s ../venv/bin/orion ~/bin
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hunter @ git+https://github.com/datastax-labs/hunter.git@8ff166979d000780ad548e49f006ef2a15d54123
hunter @ git+https://github.com/datastax-labs/hunter.git@v0.5.0
certifi==2023.11.17
click==8.1.7
elastic-transport==8.11.0
Expand All @@ -10,4 +10,4 @@ pytz==2023.3.post1
PyYAML==6.0.1
six==1.16.0
tzdata==2023.4
urllib3==1.26.18
urllib3==1.26.18

0 comments on commit 4b88c84

Please sign in to comment.