Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix container-create #759

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions modules/docker/docker.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down