2023-09-07 12:05:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-09-11 14:10:01 +00:00
|
|
|
set -x
|
|
|
|
|
|
|
|
if ! docker ps | grep -q tshwrapper ; then
|
2023-11-10 11:17:35 +00:00
|
|
|
docker run --init \
|
2023-09-11 14:10:01 +00:00
|
|
|
--entrypoint /usr/bin/sleep \
|
2023-11-10 11:17:35 +00:00
|
|
|
--name tshwrapper2 \
|
2023-09-11 14:10:01 +00:00
|
|
|
-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
|
|
|
|
|
2023-11-10 11:51:27 +00:00
|
|
|
set -- export KUBECONFIG=/root/.tsh/kube.conf \;
|
|
|
|
|
|
|
|
docker exec -ti tshwrapper /bin/sh -c "$@"
|
2023-09-11 10:24:56 +00:00
|
|
|
|
|
|
|
exit 0
|
2023-09-11 14:10:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|