main_server/containers/ttyd.fish
2022-09-28 03:50:46 +02:00

23 lines
579 B
Fish
Executable file

#!/usr/bin/env fish
if test -z $argv[1]
echo "A container number as an argument is required!"
exit 1
end
set -l container_name ttyd$argv[1]
set -l container_volumes_dir ~/volumes/$container_name
set -l container_home_dir $container_volumes_dir/home
mkdir -p $container_volumes_dir
if not test -d $container_home_dir
cp -r ~/sync/volumes/fedora_home $container_home_dir
end
podman-default-create \
$container_name \
--network traefik \
-v $container_home_dir:/home/student:Z \
-v ~/bin/linux_course:/usr/local/bin:z,ro \
localhost/ttyd:latest