Allow configuring security options
Change-Id: I27c202344c1e8be5f0e0da710c8fb18f0bc398b9
(cherry picked from commit 9b8c252b75
)
This commit is contained in:
parent
6a39021294
commit
b4bce8a3c7
|
@ -186,6 +186,8 @@ class ComposeV1Builder(object):
|
|||
cmd.append('--volumes-from=%s' % v)
|
||||
if 'log_tag' in cconfig:
|
||||
cmd.append('--log-opt=tag=%s' % cconfig['log_tag'])
|
||||
if 'security_opt' in cconfig:
|
||||
cmd.append('--security-opt=%s' % cconfig['security_opt'])
|
||||
|
||||
cmd.append(cconfig.get('image', ''))
|
||||
cmd.extend(self.command_argument(cconfig.get('command')))
|
||||
|
|
|
@ -430,7 +430,8 @@ three-12345678 three''', '', 0),
|
|||
'retries': 3
|
||||
},
|
||||
'env_file': '/tmp/foo.env',
|
||||
'log_tag': '{{.ImageName}}/{{.Name}}/{{.ID}}'
|
||||
'log_tag': '{{.ImageName}}/{{.Name}}/{{.ID}}',
|
||||
'security_opt': 'label:disable'
|
||||
}
|
||||
}
|
||||
builder = compose1.ComposeV1Builder('foo', config, None)
|
||||
|
@ -444,7 +445,8 @@ three-12345678 three''', '', 0),
|
|||
'--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s',
|
||||
'--health-timeout=10s', '--health-retries=3',
|
||||
'--privileged=true', '--restart=always', '--user=bar',
|
||||
'--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}', 'centos:7'],
|
||||
'--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',
|
||||
'--security-opt=label:disable', 'centos:7'],
|
||||
cmd
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Add `--security-opt=xxx` option for the action run a container. Allows to
|
||||
define security options, such as turning labels (SELinux) on/off.
|
Loading…
Reference in New Issue