From b489b48c0d83a02796faad6fe7a93180bc374825 Mon Sep 17 00:00:00 2001 From: tommal Date: Mon, 6 Jul 2026 13:24:12 +0200 Subject: [PATCH] fix the manager --- .dockerignore | 11 ++++++ Dockerfile | 17 +++++---- install.sh | 33 ++++++++++++++++++ .../configurator_server.cpython-313.pyc | Bin 15300 -> 15260 bytes 4 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c45cbc4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git +.agents +.codex +__pycache__ +*.pyc +*.pyo +.pytest_cache +.DS_Store +docker-run-commands.sh +manager-solution/__pycache__ +manager-solution/manager/__pycache__ diff --git a/Dockerfile b/Dockerfile index 8d97cc3..a143cf6 100755 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,12 @@ RUN mkdir -p /app /defaults \ RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && \ echo "Europe/Rome" > /etc/timezone -# The base image may include Docker's apt repository, but this image does not -# install Docker packages. Disable it so apt updates do not fail on stale keys. +# The base image may include third-party apt repositories, but this image only +# needs Debian packages. Disable inherited repos so stale keys cannot break apt. RUN rm -f /etc/apt/sources.list.d/docker.list \ - /etc/apt/sources.list.d/download_docker_com_linux_debian.list + /etc/apt/sources.list.d/download_docker_com_linux_debian.list \ + /etc/apt/sources.list.d/nodesource.list \ + /etc/apt/sources.list.d/nodesource.list.save RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -37,7 +39,8 @@ RUN apt-get update && \ && sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/' /etc/locale.gen \ && locale-gen it_IT.UTF-8 \ && update-locale LANG=it_IT.UTF-8 LC_ALL=it_IT.UTF-8 \ - && rm -rf /var/lib/apt/lists/* + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb # --- Install Microsoft core fonts (Arial, Times New Roman, Courier New, etc.) --- @@ -46,8 +49,7 @@ RUN set -eux; \ apt-get install -y --no-install-recommends \ fontconfig \ cabextract \ - xfonts-utils \ - gnupg; \ + xfonts-utils; \ \ sed -i 's/ main$/ main contrib/g' /etc/apt/sources.list; \ apt-get update; \ @@ -56,7 +58,8 @@ RUN set -eux; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ttf-mscorefonts-installer; \ \ fc-cache -f -v; \ - rm -rf /var/lib/apt/lists/* + apt-get clean; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb diff --git a/install.sh b/install.sh index 7fd5572..dfd7a27 100755 --- a/install.sh +++ b/install.sh @@ -12,6 +12,7 @@ SKIP_BUILD="${SKIP_BUILD:-0}" SKIP_MANAGER_BUILD="${SKIP_MANAGER_BUILD:-0}" PULL_APP_IMAGE="${PULL_APP_IMAGE:-0}" PULL_MANAGER_IMAGE="${PULL_MANAGER_IMAGE:-0}" +MIN_DOCKER_FREE_MB="${MIN_DOCKER_FREE_MB:-8192}" echo "Project root: ${ROOT_DIR}" echo "Manager dir: ${MANAGER_DIR}" @@ -32,6 +33,37 @@ ensure_image_exists() { fi } +check_docker_free_space() { + local docker_root + docker_root="$(docker info -f '{{.DockerRootDir}}' 2>/dev/null || true)" + if [[ -z "${docker_root}" || ! -d "${docker_root}" ]]; then + echo "Could not determine Docker root directory. Is Docker running?" >&2 + exit 1 + fi + + local available_kb available_mb + available_kb="$(df -Pk "${docker_root}" | awk 'NR == 2 {print $4}')" + available_mb=$((available_kb / 1024)) + + echo "Docker root: ${docker_root} (${available_mb} MB free)" + if (( available_mb < MIN_DOCKER_FREE_MB )); then + cat >&2 <