From 6d50caceb43d77d4978636636a2769f6dfa45345 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 12 Feb 2025 12:53:25 +0100 Subject: [PATCH] Python tests: fix Dockerfile. 1. do not use `apt` in non-interactive scripts. 2. set non-interactive frontend explicitly 3. provide `-y` for `upgrade` GitOrigin-RevId: 85a5b4bd55f1ae3ae8ee5e76b13f38962ba3c354 --- python/setup-test-environment/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/setup-test-environment/Dockerfile b/python/setup-test-environment/Dockerfile index be4aa0648ae1..8a2b191adbc4 100644 --- a/python/setup-test-environment/Dockerfile +++ b/python/setup-test-environment/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Ilya Kazakevich" # Pythons will go here ENV PYCHARM_PYTHONS=/pythons/ +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y curl gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget pgp \ @@ -21,13 +22,14 @@ RUN ./gradlew build ############################ FROM $BASE_IMAGE AS runner +ENV DEBIAN_FRONTEND=noninteractive COPY --from=builder /docker-archive-keyring.gpg /usr/share/keyrings/docker-archive-keyring.gpg RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list # xterm installs freetype, xlib, cb etc. GL is also required by some python tests # First, install certs to install docker. Then update, then install docker and other tools # Docker cli is used in tests -RUN apt-get update && apt-get install -y ca-certificates && apt upgrade && apt-get update && apt-get install -y openssl libgl1 xterm locales libsqlite3-dev apt-transport-https ca-certificates curl software-properties-common docker-ce-cli && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y ca-certificates && apt-get upgrade -y && apt-get update && apt-get install -y openssl libgl1 xterm locales libsqlite3-dev apt-transport-https ca-certificates curl software-properties-common docker-ce-cli && rm -rf /var/lib/apt/lists/* # UTF locale is required for testFileEncoding # libsqlite3 is for Django