-
Notifications
You must be signed in to change notification settings - Fork 43
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
Uncertainty regarding caching for multiple different docker images in the same pipeline #22
Comments
It doesn't work if you merge the cache steps like so? pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH ]
mount:
- /drone/docker
volumes:
- /tmp/cache:/cache
publish-base:
image: plugins/docker
registry: xxxx
repo: yyyy
dockerfile: Dockerfile.base
tags:
- latest
- ${DRONE_COMMIT_BRANCH}
- ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:8}
secrets:
- docker_username
- docker_password
storage_path: /drone/docker
purge: false
publish-zerg:
image: plugins/docker
registry: xxxx
repo: zzzz
dockerfile: Dockerfile.zerg
tags:
- latest
- ${DRONE_COMMIT_BRANCH}
- ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:8}
secrets:
- docker_username
- docker_password
storage_path: /drone/docker
purge: false
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH ]
mount:
- /drone/docker
volumes:
- /tmp/cache:/cache |
This is what it does when they each have separate restore-cache, rebuild-cache steps, after a single build has already been done:
This is what it does when they're merged into a single step after a single build has already been done, as you did above:
Separate cache steps, .drone.yml file:
Same cache step, .drone.yml file:
|
Let me know if you need any more information! |
Interesting. Logically there is no reason why this shouldn't work... This also leads me to believe this plugin is not at fault here, it may be the Docker plugin or even Docker itself. I know there's also an issue with multi-stage Dockerfiles and caching. I'll have to invest some time to figure out what's going on and why it's not working. |
Given the following pipeline, I am having trouble getting it to successfully cache the second publish step. If I use the cache_key option, I get the message 'No cache for /drone/docker' no matter how many times I run it. Am I missing something obvious?
The text was updated successfully, but these errors were encountered: