Skip to content

Commit e50e256

Browse files
committed
build(docker): disable pip_sdist mode
in github ci: COPY README.txt dist/* install/dist/ crashes the docker build if the dist directory is missing. This prevents anchore/grype from scanning the image. This is a new issue as it doesn't happen on my system. The README.txt file is there explicitly to prevent COPY from failing if nothing matches the wildcard. This used to work, but .... So I am disabling building from local sdist. This only affects maintainers. Building from sdist is done to generate a docker that matches a source distribution that has yet to be uploaded to pypi. Other use cases can build using the default of local. I haven't found a way to make a dist subdir in the docker build context directory. I can't even figure out how to identify the context directory name inside the build container. Also updated installation docs.
1 parent 1d8895e commit e50e256

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

doc/installation.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,7 @@ You can build a docker container in one of 4 modes defined by the
17541754
by some Python users.
17551755

17561756
``--build-arg="source=pip_sdist"``
1757+
Disabled.
17571758
This is meant for maintainer/developer use. It installs using
17581759
pip from a source distribution (sdist) tarball built by
17591760
following the RELEASE.txt. It is meant for testing

scripts/Docker/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ COPY locale install/locale/
129129
COPY roundup install/roundup/
130130
COPY share install/share/
131131
# dist/* might not exist, so include README.txt so we don't get an error
132-
COPY README.txt dist/* install/dist/
132+
#COPY README.txt dist/* install/dist/
133133

134134
# verify source has one of two valid values then
135135
# install in python3 standard directories from local copy
@@ -152,17 +152,18 @@ RUN [ -z "${VERBOSE}" ] || set -xv; \
152152
pip -V && \
153153
pip install --no-cache-dir . ;; \
154154
"pip_sdist") \
155+
printf "\n\npip_sdist disabled\n\n" && exit 1 ; \
155156
dist=$(find install/dist | sed -ne '/roundup-[0-9].*\.tar\.gz$/p' | tail -n 1); \
156157
if [ -z "$dist" ] ; then \
157-
printf "Unable to find a source distribution file in dist\n"; \
158-
printf "Exiting\n"; \
158+
printf "\n\nUnable to find a source distribution file in dist\n"; \
159+
printf "Exiting\n\n"; \
159160
exit 1; \
160161
fi; \
161162
printf "Building with distribution: %s\n" "$dist"; \
162163
pip install --no-cache-dir "install/dist/$dist";; \
163164
*) \
164-
echo "invalid value for source: $source"; \
165-
echo "must be local, pypi, pip_local or pip_sdist"; \
165+
printf "\n\ninvalid value for source: $source\n"; \
166+
printf "must be local, pypi, pip_local or pip_sdist\n\n"; \
166167
exit 1;; \
167168
esac
168169

0 commit comments

Comments
 (0)