kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge pull request #1100 from TimoRoth/extra_bargs
Add command line option to pass extra build argspull/1106/head
commit
4aa1d154a1
|
@ -212,6 +212,14 @@ def get_argparser():
|
||||||
default=[],
|
default=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
argparser.add_argument(
|
||||||
|
"--build-arg",
|
||||||
|
dest="build_args",
|
||||||
|
action="append",
|
||||||
|
help="Extra build arg to pass to the build process, in form name=value",
|
||||||
|
default=[],
|
||||||
|
)
|
||||||
|
|
||||||
argparser.add_argument("--subdir", type=str, help=Repo2Docker.subdir.help)
|
argparser.add_argument("--subdir", type=str, help=Repo2Docker.subdir.help)
|
||||||
|
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
|
@ -255,11 +263,12 @@ def make_r2d(argv=None):
|
||||||
r2d.appendix = args.appendix
|
r2d.appendix = args.appendix
|
||||||
|
|
||||||
for l in args.labels:
|
for l in args.labels:
|
||||||
if "=" in l:
|
key, _, val = l.partition("=")
|
||||||
key, val = l.split("=", 1)
|
|
||||||
r2d.labels[key] = val
|
r2d.labels[key] = val
|
||||||
else:
|
|
||||||
r2d.labels[l] = ""
|
for a in args.build_args:
|
||||||
|
key, _, val = a.partition("=")
|
||||||
|
r2d.extra_build_args[key] = val
|
||||||
|
|
||||||
r2d.repo = args.repo
|
r2d.repo = args.repo
|
||||||
r2d.ref = args.ref
|
r2d.ref = args.ref
|
||||||
|
|
|
@ -248,6 +248,15 @@ class Repo2Docker(Application):
|
||||||
config=True,
|
config=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
extra_build_args = Dict(
|
||||||
|
{},
|
||||||
|
help="""
|
||||||
|
Extra build args to pass to the image build process.
|
||||||
|
This is pretty much only useful for custom Dockerfile based builds.
|
||||||
|
""",
|
||||||
|
config=True,
|
||||||
|
)
|
||||||
|
|
||||||
json_logs = Bool(
|
json_logs = Bool(
|
||||||
False,
|
False,
|
||||||
help="""
|
help="""
|
||||||
|
@ -777,6 +786,8 @@ class Repo2Docker(Application):
|
||||||
}
|
}
|
||||||
if self.target_repo_dir:
|
if self.target_repo_dir:
|
||||||
build_args["REPO_DIR"] = self.target_repo_dir
|
build_args["REPO_DIR"] = self.target_repo_dir
|
||||||
|
build_args.update(self.extra_build_args)
|
||||||
|
|
||||||
self.log.info(
|
self.log.info(
|
||||||
"Using %s builder\n",
|
"Using %s builder\n",
|
||||||
bp.__class__.__name__,
|
bp.__class__.__name__,
|
||||||
|
|
Ładowanie…
Reference in New Issue