Skip to content

Conversation

@technillogue
Copy link
Contributor

@technillogue technillogue commented Sep 11, 2023

The pip install stage by default brings pip's dependencies: distutils, setuptools, wheel. Pyenv also brings these packages, so trying to symlink the ones from pip causes an error

 => CACHED [stage-1 5/7] COPY --from=deps --link /dep /dep                                                                                                                                                                   0.0s
 => ERROR [stage-1 6/7] RUN ln -s /dep/* $(pyenv prefix)/lib/python*/site-packages                                                                                                                                           0.5s
------
 > [stage-1 6/7] RUN ln -s /dep/* $(pyenv prefix)/lib/python*/site-packages:
#0 0.388 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/_distutils_hack': File exists
#0 0.388 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/distutils-precedence.pth': File exists
#0 0.389 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pkg_resources': File exists
#0 0.389 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/setuptools': File exists
#0 0.390 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/wheel': File exists
#0 0.390 ln: failed to create symbolic link '/root/.pyenv/versions/3.11.5/lib/python3.11/site-packages/wheel-0.41.2.dist-info': File exists
------
error: failed to solve: executor failed running [/bin/sh -c ln -s /dep/* $(pyenv prefix)/lib/python*/site-packages]: exit code: 1
ⅹ Failed to build Docker image: exit status 1

Signed-off-by: technillogue <technillogue@gmail.com>
@technillogue technillogue force-pushed the syl/fix-multistage-symlinks branch from abaf4a7 to a39c836 Compare September 11, 2023 15:43
@technillogue
Copy link
Contributor Author

Actually now that I look at it ln makes all of the symlinks it can even if some of them already exist, so a || true would also take care of this instead of --force

@mattt
Copy link
Contributor

mattt commented Sep 11, 2023

Happy to go with --force as a first pass, and pivot to || true if that proves problematic.

@mattt mattt merged commit 2a1a21e into main Sep 11, 2023
@mattt mattt deleted the syl/fix-multistage-symlinks branch September 11, 2023 17:39
technillogue added a commit that referenced this pull request Sep 11, 2023
Signed-off-by: technillogue <technillogue@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants