Skip to content

Commit

Permalink
Prevent removing unexpected .a files in case of re-using the Dockerfi…
Browse files Browse the repository at this point in the history
…le to build custom image (#706)

* Prevent removing unexpected .a files when building Python on top of other images

* Add a check in GitHub Actions for leftover ".a" files in "/usr/local"

Co-authored-by: Tianon Gravi <[email protected]>
  • Loading branch information
belltailjp and tianon authored Mar 24, 2022
1 parent acf9b90 commit 0a9ee3e
Show file tree
Hide file tree
Showing 32 changed files with 48 additions and 31 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ jobs:
run: |
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
strategy="$(~/bashbrew/scripts/github-actions/generate.sh)"
# https://github.com/docker-library/python/pull/706 (ensure we don't have any unexpected ".a" leftovers in "/usr/local")
strategy="$(jq <<<"$strategy" -c '
.matrix.include |= map(
if .os == "ubuntu-latest" then
.runs.test += "\n" + (
.meta.entries
| map(
.tags[0]
| "aFiles=\"$(docker run --rm \(. | @sh) find /usr/local -name \"*.a\" | tee /dev/stderr)\"; [ -z \"$aFiles\" ]"
)
| join("\n")
)
else . end
)
')"
jq . <<<"$strategy" # sanity check / debugging aid
echo "::set-output name=strategy::$strategy"
Expand Down
2 changes: 1 addition & 1 deletion 3.10/alpine3.14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.10/alpine3.15/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.10/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.10/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.10/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.10/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/alpine3.14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/alpine3.15/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.11-rc/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/alpine3.14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/alpine3.15/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.7/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/alpine3.14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/alpine3.15/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.8/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/alpine3.14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/alpine3.15/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.9/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ RUN set -eux; \
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \
{{ if [ "3.7", "3.8" ] | index(env.version) then ( -}}
-o \( -type f -a -name 'wininst-*.exe' \) \
{{
Expand Down

0 comments on commit 0a9ee3e

Please sign in to comment.