nsbin/tshwrapper-interactive

47 lines
1.5 KiB
Text
Raw Normal View History

2023-11-30 16:45:23 +00:00
#!/bin/sh
set -x
docker run -ti \
-v ~/.tsh:/home/nico/.tsh \
2023-12-08 09:36:17 +00:00
-v ~/k8s:/home/nico/k8s \
2023-11-30 16:45:23 +00:00
-v ~/.ssh:/home/nico/.ssh \
-v ~/.gnupg:/home/nico/.gnupg \
2023-12-08 09:37:36 +00:00
-e KUBECONFIG=$KUBECONFIG \
2023-11-30 16:45:23 +00:00
--entrypoint /usr/local/bin/tsh \
nicoschottelius/teleport "$@"
exit 0
docker run -t -v ~/.tsh:/root/.tsh -v ~/.ssh:/root/.ssh --entrypoint /usr/local/bin/tsh public.ecr.aws/gravitational/teleport:13 "$@"
docker run -ti -v ~/.tsh:/root/.tsh -v ~/.ssh:/root/.ssh --entrypoint /usr/local/bin/tsh public.ecr.aws/gravitational/teleport:13 "$@"
if ! docker ps | grep -q tshwrapper ; then
docker run --init \
--entrypoint /usr/bin/sleep \
--name tshwrapper2 \
-v ~/.tsh:/root/.tsh \
-p 3155:3155 \
public.ecr.aws/gravitational/teleport:13 infinity
docker exec -ti tshwrapper /bin/sh -c "apt-get update && apt-get -y install socat supervisor"
docker exec -ti tshwrapper /bin/sh -c "echo '[program:socat]' > /etc/supervisor/conf.d/socat.conf"
docker exec -ti tshwrapper /bin/sh -c "echo 'command=/usr/bin/socat tcp-listen:3155 tcp:localhost:3166' >> /etc/supervisor/conf.d/socat.conf"
docker exec -ti tshwrapper /bin/sh -c "supervisord -c /etc/supervisor/supervisord.conf"
fi
set -- export KUBECONFIG=/root/.tsh/kube.conf \;
docker exec -ti tshwrapper /bin/sh -c "$@"
exit 0
docker exec -ti tshwrapper "/bin/sh" -c "echo '(while true; do socat tcp-listen:3155 tcp:localhost:3166; done) &' > /socat.sh"
[program:socat]
command=/usr/bin/socat tcp-listen:3155 tcp:localhost:3166