Added cli to quickly run any linux distro as container

This commit is contained in:
2023-10-17 23:33:44 +05:30
parent 8602e2c893
commit f7915452e9
@@ -12,6 +12,16 @@ list-commands(){
typeset -F | cut -d ' ' -f 3 | grep -v '^_' | sort
}
# dockerLinux [imagename=ubuntu:22.40] . Quick shell inside given linux container
dockerLinux(){
set -x
local cid=$(($RANDOM%20))
local name=linux_$cid
local image=${1:-ubuntu:22.04}
docker run -d --name $name $image sh -c "trap : TERM INT; sleep infinity & wait"
docker exec -it $name sh
}
# ts / tsx to js/jsx
tstojs(){
set -x