0

This is probably a really stupid question, but one has got to start somewhere. I am playing with NVDIA's rapids.ai gpu-enhanced docker container, but this (presumably by design) does not come with pytorch. Now, of course, I can do a pip install torch torch-ignite every time, but this is both annoying and resource-consuming (and pytorch is a large download). What is the approved method for persisting a pip install in a container?

Igor Rivin
  • 4,632
  • 2
  • 23
  • 35

1 Answers1

2

Create a new Dockerfile that builds a new image based on the existing one:

FROM the/rapids-ai/image

RUN pip install torch torch-ignite

And then

$ ls Dockerfile
Dockerfile
$ docker build -t myimage .

You can now do:

$ docker run myimage
Itamar Turner-Trauring
  • 3,430
  • 1
  • 13
  • 17