lapots
lapots

Reputation: 13395

pass parameters to entrypoint in the docker

I have a console tool that can be executed like this

tool -r -b -n -x -k 'Some data'

I want to run the tool in the container but pass arguments from outside.

My Dockerfile installs the tool and the dependencies. I set there the entry point as

ENTRYPOINT ["tool"]

I want to execute it like this

docker exec --env USER=user1 .. -r -b -n -x

where it would be equal to tool -r -b -n -x. But it fails because exec doesn't have the parameter -r. How to make it pass the parameters to the container itself?

Upvotes: 1

Views: 392

Answers (1)

Michée Lengronne
Michée Lengronne

Reputation: 789

docker exec execute an aribtrary command in the container and does not take ENTRYPOINT into account.

If you want to add arguments to the ENTRYPOINT you should pass them when you execute docker run, you canno't pass arguments to the ENTRYPOINT once the container is started.

Upvotes: 2

Related Questions