Skip to content

Commit 81f8ab8

Browse files
committed
LITE-31350: Pin poetry version and reduce image size
1 parent a41abbc commit 81f8ab8

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

Dockerfile

+12-29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.10-slim
22

3-
ENV NODE_VERSION 20.9.0
3+
ENV NODE_VERSION=20.9.0
44

55
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
66
&& case "${dpkgArch##*-}" in \
@@ -53,54 +53,37 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
5353

5454

5555
RUN apt-get update; \
56-
apt-get install -y git curl tmux ca-certificates libsqlite3-dev gcc;
56+
apt-get install -y --no-install-recommends git curl tmux ca-certificates libsqlite3-dev gcc;
5757

5858

5959
ARG RUNNER_VERSION
6060

61-
RUN pip install -U pip && pip install poetry && mkdir -p /root/.config/pypoetry \
62-
&& echo "[virtualenvs]" > /root/.config/pypoetry/config.toml \
63-
&& echo "create = false" >> /root/.config/pypoetry/config.toml
61+
RUN pip install -U pip && pip install poetry==1.8.5 && poetry config virtualenvs.create false
6462

6563
COPY ./connect /install_temp/connect
66-
COPY ./pyproject.toml /install_temp/.
67-
COPY ./README.md /install_temp/.
64+
COPY ./pyproject.toml ./README.md /install_temp/
6865

6966
WORKDIR /install_temp
7067

71-
RUN poetry version ${RUNNER_VERSION}
72-
73-
RUN poetry build
74-
75-
RUN pip install dist/*.whl
76-
77-
RUN apt-get purge gcc -y; \
68+
RUN poetry version ${RUNNER_VERSION} && \
69+
poetry build && \
70+
pip install dist/*.whl; \
71+
apt-get purge gcc -y; \
7872
apt-get autoremove --purge -y; \
7973
apt-get clean -y; \
8074
rm -rf /var/lib/apt/lists/*
8175

82-
COPY ./connect/eaas/runner/artworks/ansi_regular.flf /install_temp/.
83-
COPY ./connect/eaas/runner/artworks/bloody.flf /install_temp/.
84-
85-
RUN pyfiglet -L ansi_regular.flf && pyfiglet -L bloody.flf
86-
87-
RUN rm -rf /install_temp
88-
89-
COPY ./extension-devel /usr/local/bin/extension-devel
90-
RUN chmod 755 /usr/local/bin/extension-devel
76+
COPY ./connect/eaas/runner/artworks/ansi_regular.flf ./connect/eaas/runner/artworks/bloody.flf /install_temp/
9177

92-
COPY ./extension-test /usr/local/bin/extension-test
93-
RUN chmod 755 /usr/local/bin/extension-test
78+
RUN pyfiglet -L ansi_regular.flf && pyfiglet -L bloody.flf && rm -rf /install_temp
9479

95-
COPY ./extension-check-static /usr/local/bin/extension-check-static
96-
RUN chmod 755 /usr/local/bin/extension-test
80+
COPY --chmod=755 ./extension-devel ./extension-test ./extension-check-static /usr/local/bin/
9781

9882
RUN mkdir /banners
9983

10084
COPY ./banner* /banners/
10185

102-
COPY ./entrypoint.sh /entrypoint.sh
103-
RUN chmod 755 /entrypoint.sh
86+
COPY --chmod=755 ./entrypoint.sh /entrypoint.sh
10487

10588
WORKDIR /extension
10689

0 commit comments

Comments
 (0)