main_server/containers/ttyd.fish
2023-08-13 14:48:27 +02:00

27 lines
681 B
Fish
Executable file

#!/usr/bin/env fish
if test -z $argv[1]
echo "A container number is required as the first argument!"
return 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; or return 1
if not test -d $container_home_dir
cp -r ~/fedora_home_clone $container_home_dir; or return 1
end
podman-default-create \
$container_name \
--net traefik \
-v $container_home_dir:/home/student:Z \
-v ~/bin/ttyd:/usr/local/bin:z,ro \
--cpu-shares 256 \
--cpus 8 \
--memory 8g \
--memory-reservation 1g \
localhost/ttyd:latest