Code Monkey home page Code Monkey logo

Comments (4)

ozbillwang avatar ozbillwang commented on May 17, 2024 1

got solution

https://stackoverflow.com/a/76540031/3671801

from k8s.

ozbillwang avatar ozbillwang commented on May 17, 2024

recently the automation builds are failed, will check

from k8s.

ozbillwang avatar ozbillwang commented on May 17, 2024

duplicate the issue with simple Dockerfile

FROM alpine

# Install awscli
RUN apk add --update --no-cache python3 && \
    python3 -m ensurepip && \
    pip3 install --upgrade pip setuptools && \
    pip3 install awscli && \
    pip3 cache purge

It looks totally fine, but not sure why we have below error now

[+] Building 10.0s (6/6) FINISHED                                                                                                                 docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 241B                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                                  2.5s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                     0.0s
 => CACHED [1/2] FROM docker.io/library/alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48                                            0.0s
 => ERROR [2/2] RUN apk add --update --no-cache python3 &&     python3 -m ensurepip &&     pip3 install --upgrade pip setuptools &&     pip3 install awscli &&    7.5s
------
 > [2/2] RUN apk add --update --no-cache python3 &&     python3 -m ensurepip &&     pip3 install --upgrade pip setuptools &&     pip3 install awscli &&     pip3 cache purge:
0.186 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
0.868 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
1.808 (1/17) Installing libbz2 (1.0.8-r6)
1.840 (2/17) Installing libexpat (2.5.0-r2)
1.873 (3/17) Installing libffi (3.4.4-r3)
1.898 (4/17) Installing gdbm (1.23-r1)
1.923 (5/17) Installing xz-libs (5.4.5-r0)
1.975 (6/17) Installing libgcc (13.2.1_git20231014-r0)
2.010 (7/17) Installing libstdc++ (13.2.1_git20231014-r0)
2.266 (8/17) Installing mpdecimal (2.5.1-r2)
2.301 (9/17) Installing ncurses-terminfo-base (6.4_p20231125-r0)
2.328 (10/17) Installing libncursesw (6.4_p20231125-r0)
2.387 (11/17) Installing libpanelw (6.4_p20231125-r0)
2.407 (12/17) Installing readline (8.2.1-r2)
2.456 (13/17) Installing sqlite-libs (3.44.2-r0)
2.648 (14/17) Installing python3 (3.11.6-r1)
4.770 (15/17) Installing python3-pycache-pyc0 (3.11.6-r1)
5.778 (16/17) Installing pyc (3.11.6-r1)
5.796 (17/17) Installing python3-pyc (3.11.6-r1)
5.816 Executing busybox-1.36.1-r15.trigger
5.824 OK: 51 MiB in 32 packages
7.361 error: externally-managed-environment
7.361
7.361 × This environment is externally managed
7.361 ╰─>
7.361     The system-wide python installation should be maintained using the system
7.361     package manager (apk) only.
7.361
7.361     If the package in question is not packaged already (and hence installable via
7.361     "apk add py3-somepackage"), please consider installing it inside a virtual
7.361     environment, e.g.:
7.361
7.361     python3 -m venv /path/to/venv
7.361     . /path/to/venv/bin/activate
7.361     pip install mypackage
7.361
7.361     To exit the virtual environment, run:
7.361
7.361     deactivate
7.361
7.361     The virtual environment is not deleted, and can be re-entered by re-sourcing
7.361     the activate file.
7.361
7.361     To automatically manage virtual environments, consider using pipx (from the
7.361     pipx package).
7.361
7.361 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.
7.361 hint: See PEP 668 for the detailed specification.
7.408 Traceback (most recent call last):
7.408   File "<frozen runpy>", line 198, in _run_module_as_main
7.408   File "<frozen runpy>", line 88, in _run_code
7.408   File "/usr/lib/python3.11/ensurepip/__main__.py", line 5, in <module>
7.408     sys.exit(ensurepip._main())
7.408              ^^^^^^^^^^^^^^^^^
7.408   File "/usr/lib/python3.11/ensurepip/__init__.py", line 286, in _main
7.408     return _bootstrap(
7.408            ^^^^^^^^^^^
7.408   File "/usr/lib/python3.11/ensurepip/__init__.py", line 202, in _bootstrap
7.409     return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
7.409            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7.409   File "/usr/lib/python3.11/ensurepip/__init__.py", line 103, in _run_pip
7.409     return subprocess.run(cmd, check=True).returncode
7.409            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7.409   File "/usr/lib/python3.11/subprocess.py", line 571, in run
7.410     raise CalledProcessError(retcode, process.args,
7.410 subprocess.CalledProcessError: Command '['/usr/bin/python3', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp3eh8av40/setuptools-65.5.0-py3-none-any.whl\', \'/tmp/tmp3eh8av40/pip-23.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp3eh8av40\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
------
Dockerfile:4
--------------------
   3 |     # Install awscli
   4 | >>> RUN apk add --update --no-cache python3 && \
   5 | >>>     python3 -m ensurepip && \
   6 | >>>     pip3 install --upgrade pip setuptools && \
   7 | >>>     pip3 install awscli && \
   8 | >>>     pip3 cache purge
   9 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add --update --no-cache python3 &&     python3 -m ensurepip &&     pip3 install --upgrade pip setuptools &&     pip3 install awscli &&     pip3 cache purge" did not complete successfully: exit code: 1

from k8s.

ozbillwang avatar ozbillwang commented on May 17, 2024

ok, with further debug, stuck on this line with same error

python3 -m ensurepip

with this Dockerfile

FROM alpine

# Install awscli
RUN apk add --update --no-cache python3
RUN python3 -m ensurepip
RUN pip3 install --upgrade pip setuptools
RUN pip3 install awscli
RUN pip3 cache purge

from k8s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.