2

I am able to ssh to a docker container running on a remote server. The container has no access to the internet.

Request: I want to set up my deep leaning environment in the container.

Things I can do now Data transfer between my host and the docker container is fast.

Things I do not know how to

  1. Using conda to install packages.
  2. Using pip to install packages.

Immature solution Using conda proxy to install packages directly inside the docker container. I do not know how to forward the http/https request through ssh tunnel from the docker container to the destination.

I think it might be:

  1. First configure proxy server for conda throught modifying ~/.condarc as
proxy_servers:
    http: http://localhost:9998
    https: https://localhost:9998
  1. Then ssh from my PC to the container using command like:
ssh -p port kd@mlp -R 9998:someIP:80

I tried to replace someIP with localhost or https://repo.anaconda.com/pkgs/main. None of both helps.

Is the above solution possible? What would the ssh command be look like?

Noticed that:

  1. Since there are some packages not provided by pip, conda is necessary.
  2. I have no access to the remote host and am only able to ssh to the docker container.
  3. I can not modify the docker image or relaunch the docker container.

update:

  1. There are some ways to install packages offline. However, they are not good solutions since this means I have to manually download conda/pip packages and transfer them to the corresponding docker. And I have to mannually deal with each environment. It is hoped that some solutons could setup ssh tunnel so that my conda would access the internet.
wstcegg
  • 141
  • 1
  • 9
  • See this [Stackoverflow Question](https://stackoverflow.com/questions/41577527/conda-offline-install-update) – Max Apr 10 '21 at 10:38
  • Thank you for the comment but the naive solution is not what I want. I have updated my concerns in the question body. – wstcegg Apr 10 '21 at 13:23

0 Answers0