mirror of https://github.com/docker/compose.git
Add support for build labels in 2.1 and 2.2 format
Add cache_from in 2.2 format Add integration test for build labels Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
f6aa53ea6c
commit
5fb7675055
|
@ -58,7 +58,8 @@
|
|||
"properties": {
|
||||
"context": {"type": "string"},
|
||||
"dockerfile": {"type": "string"},
|
||||
"args": {"$ref": "#/definitions/list_or_dict"}
|
||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
|
|
@ -58,7 +58,9 @@
|
|||
"properties": {
|
||||
"context": {"type": "string"},
|
||||
"dockerfile": {"type": "string"},
|
||||
"args": {"$ref": "#/definitions/list_or_dict"}
|
||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
||||
"cache_from": {"$ref": "#/definitions/list_of_strings"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
|
|
@ -666,6 +666,21 @@ class ServiceTest(DockerClientTestCase):
|
|||
assert service.image()
|
||||
assert "build_version=2" in service.image()['ContainerConfig']['Cmd']
|
||||
|
||||
def test_build_with_build_labels(self):
|
||||
base_dir = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, base_dir)
|
||||
|
||||
with open(os.path.join(base_dir, 'Dockerfile'), 'w') as f:
|
||||
f.write('FROM busybox\n')
|
||||
|
||||
service = self.create_service('buildlabels', build={
|
||||
'context': text_type(base_dir),
|
||||
'labels': {'com.docker.compose.test': 'true'}
|
||||
})
|
||||
service.build()
|
||||
assert service.image()
|
||||
assert service.image()['Config']['Labels']['com.docker.compose.test'] == 'true'
|
||||
|
||||
def test_start_container_stays_unprivileged(self):
|
||||
service = self.create_service('web')
|
||||
container = create_and_start_container(service).inspect()
|
||||
|
|
Loading…
Reference in New Issue