diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcc3d45b..7067109e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.1.27 (2019-05-08) + +### Features + +* Added ability to specify a particular Docker build stage. + + ## 2.1.26 (2019-03-14) ### Bug Fixes diff --git a/bugzoo/core/build.py b/bugzoo/core/build.py index 820dbdb4c..701dee91c 100644 --- a/bugzoo/core/build.py +++ b/bugzoo/core/build.py @@ -53,6 +53,12 @@ class BuildInstructions(object): """ depends_on = attr.ib(type=Optional[str]) + """ + The name of the build stage, if any, that should be used when building this + image. + """ + build_stage = attr.ib(type=Optional[str], default=None) + @property def name(self) -> str: return self.tag diff --git a/bugzoo/mgr/build.py b/bugzoo/mgr/build.py index db44e8785..7941c1f38 100644 --- a/bugzoo/mgr/build.py +++ b/bugzoo/mgr/build.py @@ -114,6 +114,7 @@ def build(self, tag=name, # pull=force, buildargs=instructions.arguments, + target=instructions.build_stage, decode=True, rm=True) diff --git a/bugzoo/mgr/source.py b/bugzoo/mgr/source.py index c05bf9ad1..6a6bd11c3 100644 --- a/bugzoo/mgr/source.py +++ b/bugzoo/mgr/source.py @@ -165,6 +165,7 @@ def __parse_blueprint(self, source: Source, fn: str, d: dict) -> BuildInstructio filename=d.get('file', 'Dockerfile'), arguments=d.get('arguments', {}), source=source.name, + build_stage=d.get('build-stage', None), depends_on=d.get('depends-on', None)) def __parse_bug(self, source: Source, fn: str, d: dict) -> Bug: diff --git a/bugzoo/version.py b/bugzoo/version.py index 3483687c5..0e73d99e9 100644 --- a/bugzoo/version.py +++ b/bugzoo/version.py @@ -1 +1 @@ -__version__ = '2.1.26' +__version__ = '2.1.27' diff --git a/docs/file-format.rst b/docs/file-format.rst index a7156fb18..440ae2a13 100644 --- a/docs/file-format.rst +++ b/docs/file-format.rst @@ -68,6 +68,8 @@ Below, we discuss each of the properties used to describe a blueprint: image. * The :code:`depends-on` property optionally specifies the name of the Docker image, if any, that the Docker image described by the blueprint relies on. +* The :code:`build-stage` property optionally specifies the name of the Docker + build stage that should be used to construct the image. Bugs ----