Docker Information:
Containers: 18
Running: 18
Paused: 0
Stopped: 0
Images: 188
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.0-1-amd64
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.56 GiB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Version for dockers: Docker version 1.13.1, build 092cba372
I have this docker file:
FROM debian:latest
RUN touch /var/log/mylog.log
CMD ["tail", "-F", "/var/log/mylog.log"]
Building it with docker build . -t test/testand running it with docker run -ti test/testwill cause the file to be output to stdout as follows (ignore the tail warning):
$ docker run --name test -t test/test
tail: unrecognized file system type 0x794c7630 for '/var/log/mylog.log'. please report this to bug-coreutils@gnu.org. reverting to polling
The following command will be written to a file /var/log/mylog.log, followed by a file tail:
docker exec -ti test bash -c "echo 'asd' >> /var/log/mylog.log"
Unfortunately, there is no way out on another terminal, even if it catshows that the file contains content:
$ docker exec -ti test bash -c "cat /var/log/mylog.log"
asd
Although, if I create a file with PID1 instead of creating it inside the dockerfile, I get the contents of the file with the tail. I can also get the contents of the tail if I am docker stop test && docker start testwith earlier commands.
? - docker script live?