feat: allow not binding port for node container
This commit is contained in:
+25
-10
@@ -11,18 +11,33 @@ if [[ $port == "" ]]; then
|
|||||||
port=8080
|
port=8080
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "
|
if [[ $port == "none" ]]; then
|
||||||
|
echo "
|
||||||
|
=> Mounting folder to /mnt (in container)
|
||||||
|
=> Starting container (no bound ports)
|
||||||
|
"
|
||||||
|
docker run -it \
|
||||||
|
-v $mount:/mnt \
|
||||||
|
-v ~/.config/fish:/root/.config/fish \
|
||||||
|
-v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \
|
||||||
|
--name $name \
|
||||||
|
--hostname jh-dev-container-$name \
|
||||||
|
-w /mnt \
|
||||||
|
git.janishutz.com/registry/dev-container-npm
|
||||||
|
else
|
||||||
|
echo "
|
||||||
=> Mounting folder to /mnt (in container)
|
=> Mounting folder to /mnt (in container)
|
||||||
=> Starting container
|
=> Starting container
|
||||||
=> Port $port the same internally and externally
|
=> Port $port the same internally and externally
|
||||||
"
|
"
|
||||||
|
|
||||||
docker run -it \
|
docker run -it \
|
||||||
-v $mount:/mnt \
|
-v $mount:/mnt \
|
||||||
-v ~/.config/fish:/root/.config/fish \
|
-v ~/.config/fish:/root/.config/fish \
|
||||||
-v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \
|
-v ~/projects/system/dotfiles/scripts/:/root/projects/system/dotfiles \
|
||||||
--name $name \
|
--name $name \
|
||||||
--hostname jh-dev-container-$name \
|
--hostname jh-dev-container-$name \
|
||||||
-p $port:$port \
|
-p $port:$port \
|
||||||
-w /mnt \
|
-w /mnt \
|
||||||
git.janishutz.com/registry/dev-container-npm
|
git.janishutz.com/registry/dev-container-npm
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user