It is best if you leave your ENTRYPOINT
to the default (sh -c
or my_application
), and use CMD
instead for the command parameter
CMD prm1 prm2
That means, by default, a docker run will use prm1 prm2 by default, but you can override them easily by passing new parameter on the next docker run.
That approach (above) is based on running a new container, instead of restarting an "Exited" one.
That is the common practice, as persistent data should be kept in a volume (docker volume create) that you (re-)mount onto the new container (docker run -v
)
If you were to restart your container, and benefit from different parameters, then it depends on your application:
- if said app can read those parameters from environment variables, the new
docker update
command (PR 15078, still open on issue 22490) does not yet update environment variables (only cpu and memory)
- if said app can read those from a property file, you could use
docker cp
to copy to that container an updated version of said property file, with new properties in it.