We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
Compare these 2 jobs:
Notice the difference:
Step 1/3 : FROM hello-world:linux linux: Pulling from library/hello-world 0e03bdcc26d7: Pulling fs layer 0e03bdcc26d7: Verifying Checksum 0e03bdcc26d7: Download complete 0e03bdcc26d7: Pull complete Digest: sha256:d073a5775c0b99d653c413161a8ed0e9685061afe697931d30eddf6afeef40f6 Status: Downloaded newer image for hello-world:linux ---> bf756fb1ae65 Step 2/3 : ENV hello=world ---> Running in db0fc4355854 Removing intermediate container db0fc4355854 ---> 0430147d2bd7 Step 3/3 : ENV world=hello ---> Running in b742be361e05 Removing intermediate container b742be361e05 ---> 823a4ea0983b Successfully built 823a4ea0983b
vs my own code which actually uses cache
Step 1/3 : FROM hello-world:linux linux: Pulling from library/hello-world 0e03bdcc26d7: Already exists Digest: sha256:d073a5775c0b99d653c413161a8ed0e9685061afe697931d30eddf6afeef40f6 Status: Downloaded newer image for hello-world:linux ---> bf756fb1ae65 Step 2/3 : ENV hello=world ---> Using cache ---> 5ea1c2e029fd Step 3/3 : ENV world=hello ---> Using cache ---> 7225a4358ba0 Successfully built 7225a4358ba0 Successfully tagged image:latest
Pulling image before using --cache-from does the trick:
--cache-from
docker pull lexinek/hello-world || true docker build . --tag image --cache-from lexinek/hello-world
Because the --cache-from has no effect if the image does not exist and since it runs in CI environment, the image is not pulled there 😉
The text was updated successfully, but these errors were encountered:
I guess it may be useful on self-hosted runners.
Sorry, something went wrong.
Sorry, i do not understand the comment.
The cache can work for github runners too, but to make cache work the image has to be pulled first, check my code sample in 1st comment.
No branches or pull requests
Hi!
Compare these 2 jobs:
Notice the difference:
vs my own code which actually uses cache
Pulling image before using
--cache-from
does the trick:Because the
--cache-from
has no effect if the image does not exist and since it runs in CI environment, the image is not pulled there 😉The text was updated successfully, but these errors were encountered: