Bob Fang
Bob Fang

Reputation: 7411

How to install conda package from custom file channel in Docker file?

Hi I have a custom conda channel, something like file://path_to_channel and I want to install packages from that channel when building a docker images, something like:

...
RUN conda config add -channel file://...
RUN conda install mypackage
...

The problem here is that that file path seems not to be mounted to the docker image at build time.

My question is, apart from copying the whole channel into the docker image, is there another way we can install python package from custom file based channel, in the Dockerfile, at build time.


My answer

The answer down below is correct, docker do support runtime mount now. But I did not go down this path as we are on an older docker.

To bypass this I setup an http server to serve the files. This is extremely easy if you use node or python.

Upvotes: 2

Views: 1323

Answers (1)

jcragun
jcragun

Reputation: 2198

I think this is recently possible using the RUN --mount command. (It may still even be experimental.) You can find some examples here.

An alternative is to serve the files using a local web server.

Upvotes: 3

Related Questions