How to copy a file to a Docker container via Nomad job file -
is possible?
here's nomad job file
job "test-job" { ... group "test-group" { driver = "docker" config { image = "<image-name>" } ... } }
i understand possible copy file docker image via docker build of dockerfile. want avoid of explicit creation of new docker image 'image-name' image.
i understand possible copy file running docker container derived docker image. since use nomad roll out docker images , populate containers convenient me if nomad copy (by creation on-the-fly of new docker layer file copied).
so wonder if , how possible?
i'm not sure understand question...
if trying docker image onto nomad agent, nomad can run it.. nomad you.
if trying add files docker image after it's been built during deploy..., nomad has few options.. sort of.
you can use volumes (https://www.nomadproject.io/docs/drivers/docker.html#volumes) , mount dir file in it.
alternatively can use artifact (https://www.nomadproject.io/docs/job-specification/artifact.html) , put in /local (nomad creates folder you), believe exposed docker containers default.
or, different way, have docker container on startup go fetch file(s) need. lot of people use consul-template that, built-in nomad (https://www.nomadproject.io/docs/job-specification/template.html).
none of these methods creating new docker image layer however, there no way @ deploy time, should done @ build time.
Comments
Post a Comment