-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
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
Is it possible to read the image from cache without building? #670
Comments
Don't think that's an issue with the cache but your Dockerfile. Can you post your Dockerfile or link to your repo? |
The Dockerfile is simply git is not installed on the runner I am running the job on which causes some issues. |
Ok, so I managed to get it working by installing git and fixing However, from what I can see the cache size is only 183 bytes (output from |
Yes this is expected as you don't have any runnable instructions that could be cached when using only # from.Dockerfile
FROM busybox:latest # from-run.Dockerfile
FROM busybox:latest
RUN echo "hello" name: build
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- from
- from-run
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/build-push-action@master
with:
context: .
file: ./${{ matrix.file }}.Dockerfile
cache-from: type=gha,scope=${{ matrix.file }}
cache-to: type=gha,scope=${{ matrix.file }},mode=max
|
My use case is the following:
It seems to me as if there is no way to use
docker/build-push-action@v3
without trying to build the image? From the error logs it seems at it is trying to clone my git repo and look for a dockerfile, but this is not what I want. I simply want adocker load
the contents of the cache. Is this possible?Job 1 (Github hoster runner): docker build and tag image, upload image artifact - works as expected and writes to cache
Job 2 (Self hosted runner as RunnerDeployment) - load image from cache, docker push the loaded container image to a private container registry
Error:
The text was updated successfully, but these errors were encountered: