0

So I've got a docker file like so:

FROM frolvlad/alpine-python2
MAINTAINER *REDACTED*
COPY . .
RUN pip install -r requirements.txt
RUN python misc_scripts/gen_hosts.py
RUN python misc_scripts/strip_delims.py
RUN python runparse.py -spc -spi
ENTRYPOINT ["python", "rebuild.py"]

And using the Docker API in python I'm trying to run the container like so

logs = client.containers.run(image_id, name=str(_uuid), entrypoint=['-m ME3400', '-mi NONE'])

However I get the following error

500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"-m ME3400\": executable file not found in $PATH": unknown")

I assume I'm doing it wrong, anyone know how/why this isn't working?

1 Answer 1

1

As you said in the title of your question, it should be the command argument you expect. Follow the source code on github(starting line 484), it should be more specific.

Change your code as below:

logs = client.containers.run(image_id, name=str(_uuid), command=['-m ME3400', '-mi NONE'])

Always note that CMD will treat as ENTRYPOINT's args when it exists. But if you specify another ENTRYPOINT(in your case: ['-m ME3400', '-mi NONE']), the original one(["python", "rebuild.py"]) will be overwritten.

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.