From e0670762e4d62d0e17375c9e62ac184648125e38 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 10 Mar 2022 12:08:36 -0500 Subject: .bashrc: Simplify docker rootfs helper --- .bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index a50f88d..07b9644 100644 --- a/.bashrc +++ b/.bashrc @@ -123,7 +123,10 @@ lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) --name "$contai history-remove-duplicates() { awk '!visited[$0]++' "$HOME/.bash_history" | sponge "$HOME/.bash_history"; } # extract docker container as rootfs -docker-rootfs() { id=$(docker run -d "$1" /bin/true) && docker export "$id" -o "$2.tar" && docker container rm "$id"; } +docker-rootfs() { id=$(docker run --detach "$1" /bin/true) \ + && docker export "$id" --output "rootfs.tar" \ + && docker container rm "$id" \ + && ls -l rootfs.tar; } # https://til.simonwillison.net/bash/escaping-a-string # press ctrl+d after writing string to standard input -- cgit v1.2.3