On Thu, Sep 19, 2024 at 3:09 AM Juraj Linkeš <juraj.lin...@pantheon.tech> wrote: > > > > On 18. 9. 2024 16:16, Jeremy Spewock wrote: > > On Wed, Sep 18, 2024 at 3:57 AM Juraj Linkeš <juraj.lin...@pantheon.tech> > > wrote: > >> > >> > >>> diff --git a/dts/Dockerfile b/dts/Dockerfile > >> > >>> @@ -24,9 +27,12 @@ FROM base AS runner > >> > >>> +# Adds ~/.local/bin to PATH so that packages installed with pipx are > >>> callable. `pipx ensurepath` > >>> +# fixes this issue, but requires the shell to be re-opened which isn't > >>> an option for this target. > >> > >> Let's explain this a bit more, I don't really know why this isn't an > >> option. > > > > The main reason it isn't an option is it is all happening in the same > > `docker build` process and it seems like however Docker is deciding to > > create the layers isn't refreshing the terminal. I don't think there > > is a way we could make it do so, but I can swap the "isn't an option" > > part of the comment for something more like "and the build process > > does not refresh the terminal in the required way before creating the > > next layer." > > > > Yea I think that's because each layer is basically independent so env > vars (likely set by `pipx ensurepath`) don't persist. > > I understand it now. The were multiple confusing things (how does `pipx > ensurepath` relate to ~/.local/bin, how does `pipx ensurepath` fix which > issue, why is shell mentioned and what option is not an option and why > for this target and not the other and possibly more). It basically > raised more questions than answered. :-) > > I would just say: > pipx installs packages in ~/.local/bin, which is not in PATH by default. > The `pipx ensurepath` command (which sets the path) called in the > previous step only works in that step as the docker build process
What's interesting as well is the pipx ensurepath command does fix the issue when you start the interactive dev target. So it doesn't persist between layers, but it does in the final container. > doesn't preserve env variables between steps. > > Or something like that. > > >> > >>> +ENV PATH="$PATH:/root/.local/bin" > >>> +RUN poetry install --only main --no-root > >>> > >>> -CMD ["poetry", "run", "python", "main.py"] > >>> +ENTRYPOINT ["poetry", "run", "python", "main.py"] > >>> > -- *Let's Connect!* ... *October Webinars* Ask Us Anything: IOL Services Open Q&A <https://unh.zoom.us/webinar/register/9017265932716/WN_OUo5S7iQRLmKKY7CsmwZhw#/registration>Your questions. Our answers. Let's get started. Oct 3rd Live Tour of INTACT® for IPv6 Testing and Validation <https://unh.zoom.us/webinar/register/7117231236474/WN_I2zfyi_2S2yEiXkxBRi8sA#/registration> Open tour. Open Q&A. See why we think you'll love INTACT. Oct 9th How to Prep for Our NVMe® Plugfest #21 <https://unh.zoom.us/webinar/register/4017266809553/WN_X1iA2SZ8QhmcGboF2DImNg#/registration> Checklists. Conversation. Let's get ready to plugin! Oct 15th ... * Newsletter* * * Get the IOL Connector <https://www.iol.unh.edu/news/email-newsletters> for our lastest news and event info. .