DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] dts: fix runner target in the Dockerfile
@ 2024-09-11 15:50 jspewock
  2024-09-11 15:52 ` Luca Vizzarro
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: jspewock @ 2024-09-11 15:50 UTC (permalink / raw)
  To: paul.szczepanek, npratte, alex.chapman, Honnappa.Nagarahalli,
	juraj.linkes, Luca.Vizzarro, probb, thomas, yoan.picchi,
	wathsala.vithanage
  Cc: dev, Jeremy Spewock

From: Jeremy Spewock <jspewock@iol.unh.edu>

Currently the runner target in the Dockerfile attempts to run the
`poetry install` command when building the image, but this fails due to
poetry not being found in the container. Poetry is installed in a
previous step with pipx, but doing so adds the binary to use poetry to
~/.local/bin which isn't present in the PATH variable in the container
image. The command `pipx ensurepath` fixes this issue in most cases, but
it requires a restart of the shell in order for the changes to take
place which is not something that is done in the runner target. To
solve this problem this patch manually adds ~/.local/bin to PATH in the
runner target.

Additionally, the command for installing poetry in the runner target
uses the depreciated flag --no-dev which is removed in this patch and
replaced with the new method of doing the same thing alongside the
--no-root flag from the DTS documentation.

Fixes: 19082c1fac43 ("dts: add Dockerfile")
Cc: juraj.linkes@pantheon.tech

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/Dockerfile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dts/Dockerfile b/dts/Dockerfile
index a81e46c41a..66b3cfd97f 100644
--- a/dts/Dockerfile
+++ b/dts/Dockerfile
@@ -24,7 +24,10 @@ FROM base AS runner
 # It bakes DTS into the image during the build.
 
 COPY . /dpdk/dts
-RUN poetry install --no-dev
+# 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.
+ENV PATH="$PATH:/root/.local/bin"
+RUN poetry install --only main --no-root
 
 CMD ["poetry", "run", "python", "main.py"]
 
-- 
2.46.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-09-19 14:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-11 15:50 [PATCH v1] dts: fix runner target in the Dockerfile jspewock
2024-09-11 15:52 ` Luca Vizzarro
2024-09-11 17:26   ` Patrick Robb
2024-09-16 10:16 ` Juraj Linkeš
2024-09-16 17:28   ` Jeremy Spewock
2024-09-16 18:14 ` [PATCH v2] " jspewock
2024-09-17  9:50   ` Luca Vizzarro
2024-09-17 15:22     ` Patrick Robb
2024-09-18  7:44       ` Juraj Linkeš
2024-09-18  7:57   ` Juraj Linkeš
2024-09-18 14:16     ` Jeremy Spewock
2024-09-19  7:09       ` Juraj Linkeš
2024-09-19 14:12         ` Jeremy Spewock
2024-09-19  9:36   ` Juraj Linkeš
2024-09-19 11:28     ` Juraj Linkeš
2024-09-19 14:24 ` [PATCH v3] " jspewock
2024-09-19 14:34   ` Luca Vizzarro
2024-09-19 14:35   ` Juraj Linkeš

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).