简体   繁体   中英

ENTRYPOINT without docker run

I have an executable that's containerized and I use the entry point statement in the Dockerfile :

ENTRYPOINT ["s10cmd"]

However, this is a statistical app that needs to receive a data file, so I cannot use docker run . Instead I create the container using docker create and then docker cp to copy the dat file into the container. However, none of the docker commands except run allow me to call the container as an executable.

Should I in this case, not specify ENTRYPOINT or CMD , and just do docker start , docker exec s10cmd /tmp/data.dat ?

Docker images are just like templates , and Docker containers are live running machines.

In order to execute any commands - it requires a container , so you need to create a container , when you start the container, your entry-point will launch the command and then container will close automatically.

#>docker create <-- This will create an instance of the docker image
#>docker cp     <-- Copy the relevant file into the container
#>docker start  <-- Start the container entrypoint will do rest of the job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM