[systemd-devel] Pass environment variables down to systemd-service in container

Peter Paule systemd-devel at fedux.org
Fri Jun 12 08:50:48 PDT 2015


Hi there,

is there a chance to pass (the given) environment variables down to
`unicorn` and `delayed_job-worker`?

    systemd (host)
      |
       - docker-app.service
         Environment="RAILS_ENV=production"
         Environment="DATABASE_URL=postgresql://localhost/app_development"
          |
           - docker
              |
               - systemd (container)
                  |
                   - unicorn (ruby)
                  |
                   - delayed_job-worker (ruby)

Background:

I need to wrap a rails application within CentOS-image. To make the image
re-usable I decided to use the DATABASE_URL-environment variable to configure
the database. I also need to switch the RAILS_ENV.

I'm using this image here
https://registry.hub.docker.com/u/feduxorg/centos/dockerfile/. It's based on
the official docker image which uses the `systemd-container`-package from
CentOS.




More information about the systemd-devel mailing list