Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to download artifacts from the container #23433

Closed
EugenKon opened this issue Jun 25, 2024 · 2 comments
Closed

Allow to download artifacts from the container #23433

EugenKon opened this issue Jun 25, 2024 · 2 comments

Comments

@EugenKon
Copy link

Proposal

There is a problem to fetch the template from the container we want to run: #23416 (comment)

Use-cases

It would be nice to keep the template inside the container which we want to run. Thus, depending on the container we want to run it could be possible to store it own template.

      driver = "docker"

      config {
        force_pull = false
        image = "xxx/nginx"
        volumes = [
          "custom/internal.nginx.conf:/tmp/nginx/sites-enabled/site",
        ]
      }

        artifact {
          source      = "docker://some/path/inside/container/nginx.tpl"
          destination = "local/nginx.tpl"
        }

        template {
          source        = "local/nginx.tpl"
          destination   = "custom/internal.nginx.conf"
          change_mode   = "signal"
          change_signal = "SIGHUP"
       }

Attempted Solutions

I was tried to create pre-start task which fetches the template and make it available via /alloc. But /alloc is not mounted into /opt/nomad/data/<ID>/<task>/alloc folder for tasks with docker driver.

@tgross
Copy link
Member

tgross commented Jun 25, 2024

@EugenKon the artifact and template blocks run outside of the task. They currently run in the client's context, but our long-term vision is to have them run as tasks themselves. We can't run things like template or artifact inside your tasks unless we mount consul-template binaries (or something like that) inside the task container. This wouldn't work for anything except Docker containers.

A different way to solve the problem that you've got in #23416 (comment) is to run consul-template as PID1 inside your Nginx container. I'd recommend trying something like that.

@tgross tgross closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants