mirror of https://github.com/docker/compose.git
Allow unset of entrypoint (resolves #5582)
When an empty string is passed to the 'entrypoint' parameter, for example `docker-compose run --entrypoint='' ...` OR `docker-compose run --entrypoint '' ...` It allows the default entrypoint to be overriden by empty value. Signed-off-by: Ganesh Satpute <ghsatpute@gmail.com>
This commit is contained in:
parent
9b2efd50f5
commit
59c8ed77e4
|
@ -1232,8 +1232,7 @@ def build_container_options(options, detach, command):
|
||||||
if options['--label']:
|
if options['--label']:
|
||||||
container_options['labels'] = parse_labels(options['--label'])
|
container_options['labels'] = parse_labels(options['--label'])
|
||||||
|
|
||||||
if options['--entrypoint']:
|
_build_container_entrypoint_options(container_options, options)
|
||||||
container_options['entrypoint'] = options.get('--entrypoint')
|
|
||||||
|
|
||||||
if options['--rm']:
|
if options['--rm']:
|
||||||
container_options['restart'] = None
|
container_options['restart'] = None
|
||||||
|
@ -1260,6 +1259,16 @@ def build_container_options(options, detach, command):
|
||||||
return container_options
|
return container_options
|
||||||
|
|
||||||
|
|
||||||
|
def _build_container_entrypoint_options(container_options, options):
|
||||||
|
if options['--entrypoint']:
|
||||||
|
if options['--entrypoint'].strip() == '':
|
||||||
|
# Set an empty entry point. Refer https://github.com/moby/moby/pull/23718
|
||||||
|
log.info("Overriding the entrypoint")
|
||||||
|
container_options['entrypoint'] = [""]
|
||||||
|
else:
|
||||||
|
container_options['entrypoint'] = options.get('--entrypoint')
|
||||||
|
|
||||||
|
|
||||||
def run_one_off_container(container_options, project, service, options, toplevel_options,
|
def run_one_off_container(container_options, project, service, options, toplevel_options,
|
||||||
project_dir='.'):
|
project_dir='.'):
|
||||||
if not options['--no-deps']:
|
if not options['--no-deps']:
|
||||||
|
|
Loading…
Reference in New Issue