Exporting environmental variables in containers with the same technique

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      As of version 4.8.3dev we are using two different ways of exporting environmental variables in containers with Docker and Singularity.
      For Docker we are exporting the environmental variables with the "-e" command line argument of the docker run command, while for Singularity we are exporting the environmental variables with an "export" command placed in the wrapper script that is executed in the containers and call pegasus-kickstart.

      I believe this distinction happened because Singularity doesn't provide a way to set additional environmental arguments for the container from the command line.

      However, the second solution can work for both cases and actually provide better support for Docker as well.
      Setting additional environmental variables with Docker's "-e" argument, doesn't work for all cases.
      1) We cannot do variable expansion based on an already existing variable in the container, since the container hasn't started yet.
      2) Some of the distributions tend to overwrite and not expand common variables. For example "PATH" is overwritten by Debian and Ubuntu, while CentOS expands it. So you cannot export "PATH" to a Docker container with "-e" reliably.

      So I'm suggesting to export variables in containers with the same way in both Docker and Singularity cases.

            Assignee:
            Karan Vahi
            Reporter:
            George Papadimitriou (Inactive)
            Archiver:
            Rajiv Mayani

              Created:
              Updated:
              Resolved:
              Archived: