1.13.3.3 Fetching an Image and Using it in a Task

You can fetch an image and use it in a subsequent task using the registry-image resource.

The following example downloads the alpine image from docker hub and uses it in a task to run cat /proc/version.

resources:
- name: alpine
  type: registry-image
  source:
    repository: alpine  # could also be the full URL "docker.io/alpine"

jobs:
- name: fetch-and-run
  plan:
  - get: alpine
  - task: use-fetched-image-in-task
    image: alpine   # reference the image from the get step
    config:
      platform: linux
      run:
        path: cat
        args: ["/proc/version"]