Docker compose startup errors on MacOS
birdietwin opened this issue · 4 comments
Thanks for building the Netprobe monitor! I did note a couple of issues that I wanted to share.
-
The installation on MacOS Sonoma of https://github.com/plaintextpackets/netprobe_lite throws the error "failed to solve: process "/bin/sh -c apt-get update -y && apt-get install -y python3 && apt-get install -y python3-pip && apt-get install -y iputils-ping && pip install -r /netprobe_lite/requirements.txt" did not complete successfully: exit code: 1" after "docker compose up".
-
After correcting the issue 1, the error "debconf: unable to initialize frontend: Dialog" appeared. This indicates that debconf, a configuration system for Debian packages, is trying to use a dialog-based frontend, but it fails because the Docker container does not have a user interface for dialogs. Fixed this issue by configuring debconf to use a non-interactive frontend.
-
After issue 2 was fixed, the apt-get install throws the error "error: externally-managed-environment". Worked around this error by configuring a virtual environment.
The dockerfile below is the version I used to successfully startup Netprobe.
`FROM ubuntu:latest
COPY requirements.txt /netprobe_lite/requirements.txt
ENV DEBIAN_FRONTEND=noninteractive
Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apt-get update -y
&& apt-get install -y python3
&& apt-get install -y python3-pip
&& apt-get install -y iputils-ping
&& apt-get install -y python3-venv
Setup a virtual environment if needed
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN pip install --no-cache-dir -r /netprobe_lite/requirements.txt
ENV DEBIAN_FRONTEND=dialog
WORKDIR /netprobe_lite
ENTRYPOINT [ "/bin/bash", "./entrypoint.sh" ]`
Thank you I'll review this weekend - I also put in a fix for #3 yesterday which avoids having to use a python VENV, curious if that works for your issue too
Did a fresh install on a different Mac and the update worked. Thanks!
Did you still need to change your dockerfile to add ENV DEBIAN_FRONTEND=noninteractive? Or did '--break-system-packages' fix it all?
The —break-system-packages seemed to fix it all!