profile
viewpoint

Ask questionsfeature request: docker cat command

Similar to docker cp, it would be really handy to have a docker cat command to print a file from a container or even test for its existence.

$ docker cat container:/var/run/status
status line 1
status line 2
...

$ docker cat container:/var/run/status >/dev/null || echo "File not found"
moby/moby

Answer questions flickerfly

For other looking, I was able to put together the comments here into this in order to deal with an entrypoint conflict.

docker run -it --rm -a stdout --entrypoint cat <image> <filename>

It would be nice if docker cat was aliased to docker run -it --rm -a stdout --entrypoint cat.

useful!

Related questions

Swarm restarts all containers hot 2
integration: "error reading the kernel parameter" errors during CI hot 2
can not successfully install docker-ce on ubuntu 16.04 ? why ,Can you help me? hot 1
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown hot 1
Allow COPY command's --chown to be dynamically populated via ENV or ARG hot 1
windowsRS1 and windowsRS5-process are failing due to "Unable to delete '\gopath\src\github.com\docker\docker" hot 1
Panic: runtime error: invalid memory address or nil pointer dereference hot 1
Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded hot 1
one container in the overlay network not available hot 1
Containers on overlay network cannot reach other containers hot 1
&#34;initgroups, operation not permitted&#34; error in apache2-mpm-itk when inside Docker - moby hot 1
[Windows] windowsfilter folder impossible to delete hot 1
swarm node lost leader status hot 1
New-SmbGlobalMapping don't continued working in Container hot 1
failed to export image: failed to create image: failed to get layer: layer does not exist hot 1
Github User Rank List