1

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.

1 Answer 1

1

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
``
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.