I’m trying to keep a devpi instance running inside a container throughout the build process so subsequent RUN commands can make use of it and populate it’s database during the build. e.g
FROM centos:centos7
RUN pip install devpi
RUN devpi-server --host=0.0.0.0 --port=3141
RUN some other task that interacts with devpi-server
...
Is this possible? I’ve been unable to get it working so far
2
Answers
I figured it out. I needed to add a seperate shell script that both started devpi-server and performed the commands that interacted with it. Then I can start the process and interact with it within the same RUN command.
Where start-devpi.sh looks like
I think if you want to run a certain command in the background you might need to run:
but in your case since you want to run it in background during image build time this might help you:
As you can see I am running a sleep command and ping command simultaneously by separating them with
;
let’s say in your example the estimated time to populate its database during the build might take around 2mins so setting sleep time close to that interval would solve ur problem.