How to copy a file to a Docker container via Nomad job file

Viewed 3561

Is it possible?

Here's my nomad job file

job "test-job" {
  ...
  group "test-group" {
    driver = "docker"
    config {
      image = "<image-name>"
    }
    ...
  }
}

I understand it is possible to COPY a file to a Docker image via docker build of a Dockerfile. But I want to avoid of the explicit creation of a new Docker image from the 'image-name' image.

I also understand it is possible to copy a file to a running Docker container derived from a Docker image. But since I use Nomad to roll out Docker images and populate containers it would be convenient for me if Nomad could copy (by creation on-the-fly of the new Docker layer with file copied).

So I wonder if and how it is possible?

1 Answers
Related