Skip to content

Uncertainty regarding caching for multiple different docker images in the same pipeline #22

Description

@LasseGravesen

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?

pipeline:
  restore-cache-base:
    image: drillster/drone-volume-cache
    restore: true
    environment:
      STEP_TAG: 'BASE'
    cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH, STEP_TAG ]
    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
  rebuild-cache-base:
    image: drillster/drone-volume-cache
    rebuild: true
    environment:
      STEP_TAG: 'BASE'
    cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH, STEP_TAG ]
    mount:
      - /drone/docker
    volumes:
      - /tmp/cache:/cache
      
  restore-cache-zerg:
    image: drillster/drone-volume-cache
    restore: true
    environment:
      STEP_TAG: 'ZERG'
    cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH, STEP_TAG ]
    mount:
      - /drone/docker
    volumes:
      - /tmp/cache:/cache
  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-zerg:
    image: drillster/drone-volume-cache
    rebuild: true
    environment:
      STEP_TAG: 'ZERG'
    cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_BRANCH, STEP_TAG ]
    mount:
      - /drone/docker
    volumes:
      - /tmp/cache:/cache

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions