4 ms·
>> If anything, Dockerfiles are already too powerful How? Why doesn't docker allow me to arbitrarily copy files, create any layers and execute shell commands f
by heavenlyblue 8y ago
>> If anything, Dockerfiles are already too powerful
How? Why doesn't docker allow me to arbitrarily copy files, create any layers and execute shell commands from command-line instead, as opposed to a Dockerfile?
- dvtrn 8y agoCan't you via `docker exec` or do I misunderstand the ask?
- deathanatos 8y agoYou can't `docker exec` unless the container is running, so you first need to `docker run` something. (Like an infinite sleep loop, like `bash -c 'while true; sleep 60; done'`.) You can create images via just `docker`, but it's a wee bit hard to do, IMO. IIRC, the docker command that captures the resulting image will by default also change the entrypoint to whatever the `run` was, which isn't helpful.
- heavenlyblue 8y ago>> You can create images via just `docker`, but it's a wee bit hard to do, IMO. Also if you do that, then you can't edit the ENTRYPOINT without adding another layer because docker can't edit the respective json in the .tar file directly. As in - it has the documented functionality to do so in the "POST /commit" API, but that would never work and that parameter will be simply ignored.