mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-08-17 01:10:36 +03:00
parent
36dcb7ccf2
commit
7025edf6d6
@ -11,16 +11,6 @@ def --wrapped with-flag [...flag] {
|
||||
if ($in | is-empty) { [] } else { [...$flag $in] }
|
||||
}
|
||||
|
||||
def local_image [name] {
|
||||
let s = $name | split row '/'
|
||||
if ($s | length) > 1 {
|
||||
$name
|
||||
} else {
|
||||
['localhost', $name] | str join '/'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def "nu-complete docker ns" [] {
|
||||
if $env.docker-cli == 'nerdctl' {
|
||||
^$env.docker-cli namespace list
|
||||
@ -267,7 +257,9 @@ export def image-push [
|
||||
^$env.docker-cli ...($n | with-flag -n) ...$insecure push $img
|
||||
} else {
|
||||
^$env.docker-cli ...($n | with-flag -n) tag $img $tag
|
||||
^$env.docker-cli ...($n | with-flag -n) ...$insecure push $tag
|
||||
do -i {
|
||||
^$env.docker-cli ...($n | with-flag -n) ...$insecure push $tag
|
||||
}
|
||||
^$env.docker-cli ...($n | with-flag -n) rmi $tag
|
||||
}
|
||||
}
|
||||
@ -393,7 +385,6 @@ export def container-create [
|
||||
if $dry_run {
|
||||
echo ([docker $ns run --name $name $args $img $cmd] | flatten | str join ' ')
|
||||
} else {
|
||||
let $img = if $env.docker-cli == 'nerdctl' { local_image $img } else { $img }
|
||||
^$env.docker-cli ...$ns run --name $name ...$args $img ...($cmd | flatten)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user