3

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?

Michael K
  • 1,070
  • 1
  • 10
  • 25

2 Answers2

2

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.

Josh Zarrabi
  • 1,054
  • 7
  • 15
1

From @Josh Zarrabi's answer, which I accept for its correctness I learned, not to do it. So the correct approach is to set up your own docker registry, which is very simple using the https://hub.docker.com/_/registry/ container.

Michael K
  • 1,070
  • 1
  • 10
  • 25
  • Hi, would you kindly look up my question? I tried to build my own registry too, but seemed I couldn't get it work with concourse 5.59 https://stackoverflow.com/questions/60860860/concourse-cant-connect-to-docker-repository – Mycotina Mar 26 '20 at 07:56