File: Dockerfile

package info (click to toggle)
python-elasticsearch 9.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,732 kB
  • sloc: python: 111,452; makefile: 151; javascript: 97
file content (20 lines) | stat: -rw-r--r-- 777 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ARG PYTHON_VERSION=3.14
FROM python:${PYTHON_VERSION}

# Default UID/GID to 1000
# it can be overridden at build time
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
ENV BUILDER_USER elastic
ENV BUILDER_GROUP elastic
ENV PATH="${PATH}:/var/lib/elastic/.local/bin"

# Create user
RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
    && useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \
    && mkdir -p /code/elasticsearch-py && mkdir /code/elasticsearch-py/build \
    && chown -R ${BUILDER_USER}:${BUILDER_GROUP} /code/
WORKDIR /code/elasticsearch-py
USER ${BUILDER_USER}:${BUILDER_GROUP}
RUN python -m pip install --disable-pip-version-check nox
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .