Reputation: 10058
I got an existing Docker container. I need to run a shell script inside of it:
Now I need to access via shell and run commands manually:
nvidia-docker run --publish 127.0.0.1:8080:8888 -it gcr.io/project/container:latest bin/bash
and then
cd folder/demo/folder2
python demo.py -m "./data/mydata" -o ./lalala.engine -c ./data/dadada/
jupyter lab --ip=0.0.0.0 --allow-root
How can I start container and run commands without having to do it manually.
Upvotes: 1
Views: 241
Reputation: 379
Create your own docker image (Dockerfile) by using the nvidia-docker
as base image and then override the entrypoint
with a custom script.
FROM nvidia-docker
COPY ./script.sh /scripts/script.sh
ENTRYPOINT /scripts/script.sh
and in script.sh do:
cd folder/demo/folder2
python demo.py -m "./data/mydata" -o ./lalala.engine -c ./data/dadada/
jupyter lab --ip=0.0.0.0 --allow-root
# Watever else you want
``
Upvotes: 1