From: jspewock@iol.unh.edu
To: probb@iol.unh.edu, Luca.Vizzarro@arm.com, thomas@monjalon.net,
yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
npratte@iol.unh.edu, alex.chapman@arm.com,
paul.szczepanek@arm.com, juraj.linkes@pantheon.tech,
wathsala.vithanage@arm.com
Cc: dev@dpdk.org, Jeremy Spewock <jspewock@iol.unh.edu>
Subject: [PATCH v3] dts: fix runner target in the Dockerfile
Date: Thu, 19 Sep 2024 10:24:38 -0400 [thread overview]
Message-ID: <20240919142438.10192-1-jspewock@iol.unh.edu> (raw)
In-Reply-To: <20240911155058.11321-1-jspewock@iol.unh.edu>
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 can be 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 a depreciated flag, and the --revision parameter does not work with
the runner target. To address these problems the --no-dev flag is
removed in this patch and replaced with the new method of doing the same
thing and git is added to the base target of the image. The CMD of the
runner target is also replaced with an ENTRYPOINT for ease of use.
Fixes: 19082c1fac43 ("dts: add Dockerfile")
Cc: juraj.linkes@pantheon.tech
Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
dts/Dockerfile | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dts/Dockerfile b/dts/Dockerfile
index a81e46c41a..cb23faf3d4 100644
--- a/dts/Dockerfile
+++ b/dts/Dockerfile
@@ -13,8 +13,11 @@ RUN apt-get -y update && apt-get -y upgrade && \
python3-pip \
pipx \
python3-cachecontrol \
+ git \
+ xz-utils \
openssh-client && \
- pipx install poetry>=1.8.2 && pipx ensurepath
+ pipx install poetry>=1.8.2 && pipx ensurepath && \
+ git config --global --add safe.directory /dpdk
WORKDIR /dpdk/dts
@@ -24,9 +27,14 @@ FROM base AS runner
# It bakes DTS into the image during the build.
COPY . /dpdk/dts
-RUN poetry install --no-dev
+# pipx installs packages in ~/.local/bin, which is not in PATH by default. The `pipx ensurepath`
+# command used in the previous step adds said directory to PATH, but the docker build process does
+# not preserve environment variables between steps. Therefore, ~/.local/bin must be manually added
+# into PATH in order to use the poetry command below.
+ENV PATH="$PATH:/root/.local/bin"
+RUN poetry install --only main
-CMD ["poetry", "run", "python", "main.py"]
+ENTRYPOINT ["poetry", "run", "python", "main.py"]
FROM base AS dev
@@ -35,4 +43,4 @@ FROM base AS dev
# the dependencies should be installed using Poetry.
RUN apt-get -y install --no-install-recommends \
- vim emacs git
+ vim emacs
--
2.46.0
--
*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(R)
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(R) 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 latest news and
event info.
.
next prev parent reply other threads:[~2024-09-19 14:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 15:50 [PATCH v1] " 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 ` jspewock [this message]
2024-09-19 14:34 ` [PATCH v3] " Luca Vizzarro
2024-09-19 14:35 ` Juraj Linkeš
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919142438.10192-1-jspewock@iol.unh.edu \
--to=jspewock@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=Luca.Vizzarro@arm.com \
--cc=alex.chapman@arm.com \
--cc=dev@dpdk.org \
--cc=juraj.linkes@pantheon.tech \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=thomas@monjalon.net \
--cc=wathsala.vithanage@arm.com \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).