I have a Dockerized Jupyter Notebook always running on a Linux host (where I have ssh access).
docker run -d \
--hostname="$(logname)-sandbox" \
-e NB_UID="$(id -u $(logname))" \
-e NB_GID="$(id -g $(logname))" \
-e GRANT_SUDO=1 \
-e NB_USER="$(id -un $(logname))" \
-e NB_GROUP="$(id -gn $(logname))" \
--user=root \
--restart=always \
--name="$(logname)-sandbox" \
-v "${HOME}":"/home/$(logname)" \
-p 8010:8888 \
jupyter/base-notebook:latest \
start-notebook.sh --notebook-dir="/home/$(logname)"
Currently I need to first ssh into the host, then I do something like docker exec -it <container-name> bash
to start a bash shell within the Docker container.
I was wondering if there was a way of proxying the initial ssh command into the container, in much the same way as ProxyCommand does to connect to a second host indirectly.
exec docker exec -it <container> bash
. This makes it difficult to get back to the host (which is actually what I want in my case. Are there any ways to break out? What is the correct platform for conversations like this? I think Stackoverflow frowns upon meta-discussion.