tools/containerfiles: fix docker warning
PATCH 1/1 tools/containerfiles: fix docker warning
The current Containerfiles produce the following warning with docker:
1 warning found (use docker --debug to expand):
- UndefinedVar: Usage of undefined variable '$PWD' (line 12)
Remove $PWD and set the WORKDIR so that our pip3_docs.sh script finds the virtual env.
--- documentation/tools/containerfiles/Containerfile.apt | 6 +++++- documentation/tools/containerfiles/Containerfile.dnf | 6 +++++- documentation/tools/containerfiles/Containerfile.zypper | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-)
documentation/tools/containerfiles/Containerfile.apt +5 -1
@@ -9,9 +9,13 @@ FROM $ARG_FROM # container, and it must match the pwd when pip3_docs.sh is run in a later # layer. This *must* be outside of any mount point otherwise it won't be # available within the container. -ENV VIRTUAL_ENV=$PWD/yocto-docs-venv +ENV VIRTUAL_ENV=/yocto-docs-venv ENV PATH="$VIRTUAL_ENV/bin:$PATH" +# Set the WORKDIR to / so the pip3_docs.sh script will find our virtual env +# when calling '. ./yocto-docs-venv/bin/activate'. +WORKDIR / + ARG INCLUDE_ESSENTIAL_PACKAGES=0 ARG ESSENTIAL=ubuntu_essential.sh ARG DOCS=ubuntu_docs.sh
documentation/tools/containerfiles/Containerfile.dnf +5 -1
@@ -9,9 +9,13 @@ FROM $ARG_FROM # container, and it must match the pwd when pip3_docs.sh is run in a later # layer. This *must* be outside of any mount point otherwise it won't be # available within the container. -ENV VIRTUAL_ENV=$PWD/yocto-docs-venv +ENV VIRTUAL_ENV=/yocto-docs-venv ENV PATH="$VIRTUAL_ENV/bin:$PATH" +# Set the WORKDIR to / so the pip3_docs.sh script will find our virtual env +# when calling '. ./yocto-docs-venv/bin/activate'. +WORKDIR / + ARG INCLUDE_ESSENTIAL_PACKAGES=0 ARG ESSENTIAL=fedora_essential.sh ARG DOCS=fedora_docs.sh
documentation/tools/containerfiles/Containerfile.zypper +5 -1
@@ -9,9 +9,13 @@ FROM $ARG_FROM # container, and it must match the pwd when pip3_docs.sh is run in a later # layer. This *must* be outside of any mount point otherwise it won't be # available within the container. -ENV VIRTUAL_ENV=$PWD/yocto-docs-venv +ENV VIRTUAL_ENV=/yocto-docs-venv ENV PATH="$VIRTUAL_ENV/bin:$PATH" +# Set the WORKDIR to / so the pip3_docs.sh script will find our virtual env +# when calling '. ./yocto-docs-venv/bin/activate'. +WORKDIR / + ARG INCLUDE_ESSENTIAL_PACKAGES=0 ARG ESSENTIAL=opensuse_essential.sh ARG DOCS=opensuse_docs.sh
---
base-commit: ba351b35480d9c06c870a6f34d8bdbc1856b9511
change-id: 20260227-fix-docker-build-warning-812177bd3302
Hi Antonin,
Quoted 8 lines · Antonin Godard
The current Containerfiles produce the following warning with docker:
1 warning found (use docker --debug to expand):
- UndefinedVar: Usage of undefined variable '$PWD' (line 12)Remove $PWD and set the WORKDIR so that our
pip3_docs.shscript finds the virtual env.
Thanks!
Quentin
Antonin Godard
AppliedApplied, thanks!
[1/1] tools/containerfiles: fix docker warning
commit: d97cfeaa55ed42722998d3313c1857aa377f6881