Skip to content

Commit 389c311

Browse files
committed
Running ES docker container with Elastic user
1 parent c6a935f commit 389c311

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.ci/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
1313
&& useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \
1414
&& mkdir -p /code/elasticsearch-py && mkdir /code/elasticsearch-py/build \
1515
&& chown -R ${BUILDER_USER}:${BUILDER_GROUP} /code/elasticsearch-py
16-
1716
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
18-
19-
USER ${BUILDER_USER}:${BUILDER_GROUP}
2017
WORKDIR /code/elasticsearch-py
18+
USER ${BUILDER_USER}:${BUILDER_GROUP}
2119
COPY dev-requirements.txt .
2220
RUN python -m pip install \
2321
-U --no-cache-dir \
2422
--disable-pip-version-check \
2523
nox -rdev-requirements.txt
26-
27-
COPY . .
28-
RUN python -m pip install -e .
24+
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
25+
RUN python -m pip install -U -e .

.ci/run-elasticsearch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ END
116116
echo -e "\033[34;1mINFO:\033[0m Starting container $node_name \033[0m"
117117
set -x
118118
docker run \
119+
-u "$(id -u)" \
119120
--name "$node_name" \
120121
--network "$network_name" \
121122
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g -da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions" \

.ci/run-repository.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ echo -e "\033[1m>>>>> Run [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>
3333

3434
mkdir -p junit
3535
docker run \
36+
-u "$(id -u)" \
3637
--network=${network_name} \
3738
--env "STACK_VERSION=${STACK_VERSION}" \
3839
--env "ELASTICSEARCH_URL=${elasticsearch_url}" \

0 commit comments

Comments
 (0)