feat: dev container startup script fixes and docker auto-start
This commit is contained in:
+21
-11
@@ -8,15 +8,7 @@ else
|
|||||||
name=$(pwd | rev | cut -d "/" -f 1 | rev)
|
name=$(pwd | rev | cut -d "/" -f 1 | rev)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "rm" ]]; then
|
if [[ $1 == "help" ]]; then
|
||||||
echo "
|
|
||||||
janishutz dev containers
|
|
||||||
|
|
||||||
-> Removing container $name <-
|
|
||||||
"
|
|
||||||
docker stop $name
|
|
||||||
docker container rm $name
|
|
||||||
elif [[ $1 == "help" ]]; then
|
|
||||||
echo "
|
echo "
|
||||||
dev-containers [container|rm|help] [name]
|
dev-containers [container|rm|help] [name]
|
||||||
|
|
||||||
@@ -28,13 +20,31 @@ Container can be one of:
|
|||||||
- torch-rocm
|
- torch-rocm
|
||||||
- vue
|
- vue
|
||||||
- webserver
|
- webserver
|
||||||
rm removes the container for the current directory if provided name is equal, or unspecified.
|
rm removes the container for the current directory if provided name is existing container, or unspecified.
|
||||||
"
|
"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(systemctl is-active docker) != "active" ]]; then
|
||||||
|
echo "
|
||||||
|
Docker daemon not running, starting with systemctl
|
||||||
|
"
|
||||||
|
sudo systemctl start docker
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "rm" ]]; then
|
||||||
|
echo "
|
||||||
|
janishutz dev containers
|
||||||
|
|
||||||
|
-> Removing container $name <-
|
||||||
|
"
|
||||||
|
docker stop $name
|
||||||
|
docker container rm $name
|
||||||
else
|
else
|
||||||
echo "
|
echo "
|
||||||
janishutz dev containers
|
janishutz dev containers
|
||||||
|
|
||||||
-> Creating container $name <-
|
-> Creating container $name <-
|
||||||
"
|
"
|
||||||
eval "${base_path}/$1-container $name $mount_path"
|
eval "${base_path}$1-container $1-$name $mount_path"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user