Search code examples
concourse

How to use a local docker image as resource in concourse-docker


I try to run a task in a docker image, which is not uploaded to docker hub, but instead installed locally (using docker build -t tagname/tagname .) So it exists on the (only) worker.

image_resource:
  type: docker-image
  source: {repository: tagname/tagname}

However, that approach fails with the following error:

enter image description here

Is there an easy way to have concourse run a docker image without having to push it to docker hub nor to set up a local repository?


Solution

  • This is possible with the rootfs_uri task parameter.

    You will have to find out where exactly in the worker filesystem the rootfs created by docker build is stored, and then reference it in the task with rootfs_uri: file://<your_rootfs>.

    As the documentation says this is not recommended as you are not taking advantage of any of the concourse image caching logic.