Change location & type of fix

The initial plan was to modify our copy of the environment variables as
set via cli argparsing at the point-of-use. However, that function's
purpose is to launch a container.  Adding argument processing doesn't
feel right.

The new plan is to modify our copy of the environment when the arguments
are parsed. `argparse` provides a hook to do such work: custom actions.
pull/874/head
Hal Wine 2020-04-18 10:23:38 -07:00
rodzic af5d9c7129
commit 2c9027eb80
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -158,6 +158,10 @@ def get_argparser():
"--user-name", help="Username of the primary user in the image"
)
# Process the environment options the same way that docker does, as
# they are passed directly to docker as the environment to use. This
# requires a custom action for argparse.
# see https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file
argparser.add_argument(
"--env",
"-e",

Wyświetl plik

@ -560,8 +560,6 @@ class Repo2Docker(Application):
"mode": "rw",
}
# self.environment needs to be modified to match the semantics
# of docker's --env option
run_kwargs = dict(
publish_all_ports=self.all_ports,
ports=ports,