Merge branch 'master' of ssh://git.chaoticlogic.us:2302/daniel/dotfiles-generator
This commit is contained in:
commit
c48a2f027f
@ -218,11 +218,14 @@ EOS
|
|||||||
index=$(docker ps -a --filter "name=docker-env-$image_repository-*" --format '{% raw %}{{.Names}}{% endraw %}' | perl -e 'my $max = 0; while (<>) {my ($n) = $_ =~ /(\d+)$/; if ($n > $max) { $max = $n };}; print $max+1;')
|
index=$(docker ps -a --filter "name=docker-env-$image_repository-*" --format '{% raw %}{{.Names}}{% endraw %}' | perl -e 'my $max = 0; while (<>) {my ($n) = $_ =~ /(\d+)$/; if ($n > $max) { $max = $n };}; print $max+1;')
|
||||||
name="docker-env-$image_repository-$index"
|
name="docker-env-$image_repository-$index"
|
||||||
|
|
||||||
run_command="docker run --rm -it --name \"$name\" -v $(pwd):/work_dir "
|
run_command="docker run --rm -it --name \"$name\" -v \"$(pwd):/work_dir\" "
|
||||||
|
|
||||||
run_command+="${run_command_switches[*]}"
|
for run_command_switch in $run_command_switches
|
||||||
|
do
|
||||||
|
run_command+="\"$run_command_switch\" "
|
||||||
|
done
|
||||||
|
|
||||||
run_command+=" -w \"$workdir\" \"$image\" $cmd"
|
run_command+="-w \"$workdir\" \"$image\" $cmd"
|
||||||
|
|
||||||
eval $run_command
|
eval $run_command
|
||||||
}
|
}
|
||||||
@ -240,8 +243,8 @@ function _docker-env() {
|
|||||||
"-h[Container host name]" \
|
"-h[Container host name]" \
|
||||||
"-m[Memory limit]" \
|
"-m[Memory limit]" \
|
||||||
"-u[Username or UID (format: (<name|uid>|(<name|uid>:<group|gid>)))]" \
|
"-u[Username or UID (format: (<name|uid>|(<name|uid>:<group|gid>)))]" \
|
||||||
"(-p -e -v -w)--[Explicitely stop switches and start positional arguments]" \
|
"(-p -e -v -w -h -m -u)--[Explicitely stop switches and start positional arguments]" \
|
||||||
"(-p -e -v -w --)1:Container image:->image" \
|
"(-p -e -v -w -h -m -u --)1:Container image:->image" \
|
||||||
"*:Container CMD:->cmd"
|
"*:Container CMD:->cmd"
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user