Since exporting the cache can take a little while, (around 90-120 seconds in my testing). I was wondering if I could do it in a separate command.
The reasoning for this is I would like to notify my deployment that a new image is available as soon as the registry push of the build image is complete.
Currently if I do this, my new build is deployed after the cache is exported and pushed.
buildctl build ... \
--output type=image,name=localhost:5000/myrepo:image,push=true \
--export-cache type=registry,ref=localhost:5000/myrepo:buildcache \
--import-cache type=registry,ref=localhost:5000/myrepo:buildcache \
# command for k8s deployment to use new build
kubectl rollout restart deployment $APP_NAME -n=$NAMESPACE
Ideally I'd like to do something like this:
buildctl build ... \
--output type=image,name=localhost:5000/myrepo:image,push=true \
--import-cache type=registry,ref=localhost:5000/myrepo:buildcache \
# command for k8s deployment to use new build
kubectl rollout restart deployment $APP_NAME -n=$NAMESPACE
# export cache after
buildctl export-cache ... \
--export-cache type=registry,ref=localhost:5000/myrepo:buildcache \
Since exporting the cache can take a little while, (around 90-120 seconds in my testing). I was wondering if I could do it in a separate command.
The reasoning for this is I would like to notify my deployment that a new image is available as soon as the registry push of the build image is complete.
Currently if I do this, my new build is deployed after the cache is exported and pushed.
Ideally I'd like to do something like this: