Ah, I see.. ok, that's more of a change than I initially expected. If it were just some permission / ownership problems it could be solved with a COPY --chown, but the python stuff is on a named path...
My main issue with the ros2 base image is that it's not really the responsibility of this repo to know what the downstream users will be. This image could also be used to provide pre-built binaries to other ubuntu users, for example, and then it's the same question about how to copy user-specific paths.
Probably the "right" solution is to put all the build outputs in specific folders. For example, maybe keep just the .local folder of python, not the whole python home path. So instead of a straight COPY from=cl / / in the downstream dockerfile, you would have to do something like
COPY from=cl /apt-deps /
COPY from=cl --chown=${USER}:${USER} /usr /usr
COPY from=cl --chown=${USER}:${USER} /python/.local /home/${USER}/.local
ubuntu is slightly annoying because we'd have to configure a user again
A lot of the user setup in development dependencies was also about permissions and SSH, so in the end it might not be so bad to have a simple user.
I think all that is nice to try at some point to make this image a bit more generic, but it's also not the most important thing.
Anyway TL;DR, it's a bit of pain to do all this and I don't want to enforce a cumbersome process / delay other work; if we are the main users of this image for now, then it's fine to revert back to ros2 base image and keep this idea in the backlog.
Originally posted by @eeberhard in #137 (comment)
Ah, I see.. ok, that's more of a change than I initially expected. If it were just some permission / ownership problems it could be solved with a
COPY --chown, but the python stuff is on a named path...My main issue with the ros2 base image is that it's not really the responsibility of this repo to know what the downstream users will be. This image could also be used to provide pre-built binaries to other ubuntu users, for example, and then it's the same question about how to copy user-specific paths.
Probably the "right" solution is to put all the build outputs in specific folders. For example, maybe keep just the
.localfolder of python, not the whole python home path. So instead of a straightCOPY from=cl / /in the downstream dockerfile, you would have to do something likeA lot of the user setup in development dependencies was also about permissions and SSH, so in the end it might not be so bad to have a simple user.
I think all that is nice to try at some point to make this image a bit more generic, but it's also not the most important thing.
Anyway TL;DR, it's a bit of pain to do all this and I don't want to enforce a cumbersome process / delay other work; if we are the main users of this image for now, then it's fine to revert back to ros2 base image and keep this idea in the backlog.
Originally posted by @eeberhard in #137 (comment)