buildpacks / roadmap

Issue tracker
https://buildpacks.io
Apache License 2.0
0 stars 0 forks source link

pack build --clear-cache #30

Closed ekcasey closed 5 years ago

ekcasey commented 5 years ago

Given I have a cache volume associated with my app image When I call pack build or pack run with the --clear-cache flag Then The old cache volume associated with the specific image is deleted and a clean cache volume is supplied for the build

Notes

sclevine commented 5 years ago

With --clear-cache, I consistently get:

liberty:pack pivotal$ ./pack-676-osx build myapp --builder packs/samples:0.0.1-rc.490 --buildpack ./test-bp/ --env-file <(echo 'TESTME=pass') --clear-cache
Defaulting app directory to current working directory /Users/pivotal/workspace/cncf-buildpacks/pack (use --path to override)
Using user-provided builder image packs/samples:0.0.1-rc.490
Pulling builder image packs/samples:0.0.1-rc.490 (use --no-pull flag to skip this step)
Selected run image packs/run:v3alpha2 from stack io.buildpacks.stacks.bionic
Pulling run image packs/run:v3alpha2 (use --no-pull flag to skip this step)
Using cache volume pack-cache-7bae996a0e238a80f14b74a61e3178bf
ERROR: clearing cache: Error response from daemon: remove pack-cache-7bae996a0e238a80f14b74a61e3178bf: volume is in use - [1ac007e017a7e066ddbfd7e224f9d34ad1f6e3dc4b57328052c8c07904434b9c]

This consistently fails (and building without --clear-cache consistently succeeds) regardless for every interleaving of them with the same image name.

sclevine commented 5 years ago

@ekcasey

ameyer-pivotal commented 5 years ago

@sclevine We noticed that too and it went away when we ensured acceptance tests were not running parallel. Interesting that it still happens. Wonder if we should just manually empty the directory, rather than use the docker CLI to remove the volume.

ekcasey commented 5 years ago

@ameyer-pivotal @sclevine Sounds to me like we are leaving a stopped container around after pack build, we should probably fix that, including in cases where build was interrupted.

sclevine commented 5 years ago

Agree that we should remove the stopped container. Would prefer to re-create the volume instead of clearing the directory.

sclevine commented 5 years ago

Resolution:

mgibson1121 commented 5 years ago

Accepted this with @ekcasey on 1/25