builder: fix layer leak on multi-stage wildcard copy#37178
Merged
vdemeester merged 1 commit intomoby:masterfrom May 31, 2018
Merged
builder: fix layer leak on multi-stage wildcard copy#37178vdemeester merged 1 commit intomoby:masterfrom
vdemeester merged 1 commit intomoby:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #37178 +/- ##
=========================================
Coverage ? 34.99%
=========================================
Files ? 615
Lines ? 45930
Branches ? 0
=========================================
Hits ? 16074
Misses ? 27745
Partials ? 2111 |
Member
|
Looking good now: Build, and start development container; Start daemon in the container; Create the test-script; #!/bin/sh
set -e
build_image_ok() {
docker image build --quiet --no-cache -t my_app:$1 -<<-EOF 1> /dev/null
FROM busybox AS build
RUN touch /vraag.html
FROM scratch
COPY --from=build /vraag.html ./
EOF
docker image prune -af | tail -1
printf "Directories in /var/lib/docker/overlay2: "
find /var/lib/docker/overlay2 -maxdepth 1 -type d | wc -l
}
build_image_faulty() {
docker image build --quiet --no-cache -t my_app:$1 -<<-EOF 1> /dev/null
FROM busybox AS build
RUN touch /vraag.html
FROM scratch
COPY --from=build /*.html ./
EOF
docker image prune -af | tail -1
printf "Directories in /var/lib/docker/overlay2: "
find /var/lib/docker/overlay2 -maxdepth 1 -type d | wc -l
}
run_test() {
echo "Running ok case:"
i=1
while [ $i -le 3 ]; do
build_image_ok $i
i=$(( i+1 ))
done
echo ""
echo "Running faulty case:"
i=1
while [ $i -le 3 ]; do
build_image_faulty $i
i=$(( i+1 ))
done
}
run_testRun the test; |
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


fixes #37077
Signed-off-by: Tonis Tiigi tonistiigi@gmail.com