From 0d1ab11ac40158ddec725c0be7a89ee9bb04d012 Mon Sep 17 00:00:00 2001 From: Grigori Fursin Date: Thu, 27 May 2021 10:30:30 +0200 Subject: [PATCH] added --command flag to "run docker" to run a specific command such as ck run docker:xyz --command="ck show env" --- CHANGES.txt | 2 ++ ck/repo/module/docker/module.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 274989d56b..b33c0347f6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,8 @@ * V2.4.0.1 * added --bash to docker:module to run bash in a container * removed outdated and unnecessary files + * added --command flag to "run docker" to run a specific command such as + ck run docker:xyz --command="ck show env" * V2.4.0 * added module "docker.template" to support adaptive CK containers diff --git a/ck/repo/module/docker/module.py b/ck/repo/module/docker/module.py index 2ec9d9d3f2..8537fbc18f 100644 --- a/ck/repo/module/docker/module.py +++ b/ck/repo/module/docker/module.py @@ -62,7 +62,8 @@ def run(i): Input: { data_uoa - CK entry with Docker description (scenario) - scenario to get CMD (default if empty) - (cmd) - extra CMD + (command) - extra CMD (at the beginning of the docker command) + (cmd) - extra CMD (at the end of the docker command) (bash) - if 'yes', add "bash" at the end of CMD } @@ -280,6 +281,10 @@ def call(i): if i.get('bash','')=='yes': c+=' bash' + if i.get('command','')!='': +# c+=' "'+i['command']+'"' + c+=' "'+i['command']+'"' + c='docker '+func+' '+c # Update vars from input