Comments (12)
I'll see about getting an example in there.
In the meantime, this cloudbuild.yaml will do a docker build
that uses, as its cache, the previous image built by the same config file.
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/$PROJECT_ID/my-image']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--cache-from', 'gcr.io/$PROJECT_ID/my-image', '-t', 'gcr.io/$PROJECT_ID/my-image', '.']
images: ['gcr.io/$PROJECT_ID/my-image']
from cloud-builders.
Hi Daniel,
We are looking into this upgrade, but have no specific date yet.
from cloud-builders.
We have now upgraded to Docker 17.05, so --cache-from is available. Let us know how it goes!
from cloud-builders.
i can't seem to get --cache-from to work
from cloud-builders.
Did you docker pull
the image into the job first? --cache-from
won't work unless the image is already available on the host. Seems like an odd design choice on their part, but there you go.
from cloud-builders.
This works for me, but a minimal cloudbuild.yaml
example that included both the pull and build with --cache-from
would have helped me.
from cloud-builders.
yea.. figured it out right after writing.. sadly the pull step is really slow 😞 and in the end my build time only went down from 11 mins to around 8. still an improvement, but i was hoping for more.
from cloud-builders.
How big is your image and how long does it take to pull?
from cloud-builders.
i think my image is 1.6GB i have moved everything to us.gcr.io to try and get the pull time down, but it aint helping much. i'll have to try and slim down my image, i found out that i can slim it at least 400mb by removing some duplicated images.
from cloud-builders.
A 1.6GB image will likely take several minutes to download. If you point me at your build process I'd be happy to consult on slimming the image (one of my secret hobbies).
from cloud-builders.
The problem is that google hasn't found a way to add backend_buckets to ingress on GKE, so right now i'm uploading all of my static files to the docker image to get automatic CDN. And since i'm using django all my static files are duplicated for cache-busting. I'm currently working on moving my static files to cloud storage and for now it seems i have to pay for an extra load balancer to get CDN support for those files.
from cloud-builders.
If you have duplicated files in multiple layers, you might benefit from squashing them. See https://stackoverflow.com/questions/41764336/how-does-the-new-docker-squash-work
from cloud-builders.
Related Issues (20)
- go:latest uses 1.15 instead of the newer 1.21 images which are present HOT 2
- [BUG] Java Builder doc currently recommends openjdk (DEPRECATED) should recommend Temurin HOT 1
- Docker build squash HOT 1
- [BUG] Bazel image missing `python3-distutils`
- [BUG] kubectl - memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused HOT 3
- [FR] xp.zen.one.zip.MAXFIELD.dev.GT.snapdragon.K3M.oxford.USNRx.fugk.ZoeOzone.ZOZANZI.xia.xiu.BuGzLoPœvzg.opus.hummingbird.circa.VELOTRIX.sexpixel.clarity.verity 609 https://t.co/gadgetgreen
- [BUG] Recent commit for 'latest' tag was a breaking change for many
- [BUG] Latest gcloud image throws (AttributeError): 'bool' object has no attribute 'lower' HOT 2
- [BUG] Cloud Build Error
- [BUG] npm 9.7.0 HOT 2
- Docs refer to stale bazel-provided images, new images aren't compatible with Cloud Build HOT 2
- [BUG] gke-deploy generated files fail deployment HOT 2
- yarn image has outdated node versions
- [FR] Add labels to cloud-builder images
- [BUG] gke-deploy does not respect the declared ApiVersion
- How to pass credentials to GKE-DEPLOY HOT 1
- [FR] Update Bazel to 7.x HOT 2
- [FR] Remove mandatory dependence on gsutil HOT 1
- [BUG] kubectl builder finds wrong context when executed in parallel HOT 1
- [BUG] `/gke-deploy: No such file or directory` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-builders.