Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build the docker image #253

Open
agross opened this issue Dec 18, 2023 · 1 comment
Open

Unable to build the docker image #253

agross opened this issue Dec 18, 2023 · 1 comment

Comments

@agross
Copy link

agross commented Dec 18, 2023

I need to build the docker image for the ARM platform because I use it on a Raspberry Pi. It seems the image cannot be built because there is an issue with pip.

Building Dockerfile

 => ERROR [6/7] RUN pip3 --no-cache-dir install .                                                                                                   7.6s
------
 > [6/7] RUN pip3 --no-cache-dir install .:
6.671 error: externally-managed-environment
6.671
6.671 × This environment is externally managed
6.671 ╰─>
6.671     The system-wide python installation should be maintained using the system
6.671     package manager (apk) only.
6.671
6.671     If the package in question is not packaged already (and hence installable via
6.671     "apk add py3-somepackage"), please consider installing it inside a virtual
6.671     environment, e.g.:
6.671
6.671     python3 -m venv /path/to/venv
6.671     . /path/to/venv/bin/activate
6.671     pip install mypackage
6.671
6.671     To exit the virtual environment, run:
6.671
6.671     deactivate
6.671
6.671     The virtual environment is not deleted, and can be re-entered by re-sourcing
6.671     the activate file.
6.671
6.671     To automatically manage virtual environments, consider using pipx (from the
6.671     pipx package).
6.671
6.671 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
6.671 hint: See PEP 668 for the detailed specification.
------
Dockerfile:17
--------------------
  15 |      && find /opt/grafana-backup-tool -type d -print0 | xargs -0 chmod a+rx
  16 |
  17 | >>> RUN pip3 --no-cache-dir install .
  18 |
  19 |     RUN chown -R 1337:1337 /opt/grafana-backup-tool
--------------------

Building DockerfileSlim

29.91 error: externally-managed-environment
29.91
29.91 × This environment is externally managed
29.91 ╰─>
29.91     The system-wide python installation should be maintained using the system
29.91     package manager (apk) only.
29.91
29.91     If the package in question is not packaged already (and hence installable via
29.91     "apk add py3-somepackage"), please consider installing it inside a virtual
29.91     environment, e.g.:
29.91
29.91     python3 -m venv /path/to/venv
29.91     . /path/to/venv/bin/activate
29.91     pip install mypackage
29.91
29.91     To exit the virtual environment, run:
29.91
29.91     deactivate
29.91
29.91     The virtual environment is not deleted, and can be re-entered by re-sourcing
29.91     the activate file.
29.91
29.91     To automatically manage virtual environments, consider using pipx (from the
29.91     pipx package).
29.91
29.91 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
29.91 hint: See PEP 668 for the detailed specification.
------
DockerfileSlim:32
--------------------
  31 |
  32 | >>> RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
  33 | >>>     && apk add --no-cache --virtual build-deps ${DEV_PACKAGES} \
  34 | >>>     && apk add --no-cache ${PACKAGES} \
  35 | >>>     && pip3 --no-cache-dir install . \
  36 | >>>     && chown -R ${UID}:${GID} /opt/grafana-backup-tool \
  37 | >>>     && apk del build-deps
  38 |
--------------------
@declan-fitzpatrick
Copy link
Contributor

For a quick and nasty fix you can edit the run command with --break-system-packages, or I've added venv in #262

RUN pip3 --no-cache-dir install . --break-system-packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants