Hi I have issue with Filebeat service does not run inside container with systemd during docker run.
I want to create a container with systemd init process as PID 1 and
filebeat service should be run as a child to PID 1. The filebeat service
is starting through python script and that would be executed by docker
ENTRYPOINT.
The container is running with /usr/sbin/init process as PID 1 but it is
unable to start the filebeat service, but if i execute the same python
script manually inside the container, filebeat service is running
Steps to reproduce the issue:
docker build -t filebeat_img .docker run -itd --privileged --name filebeat_cont filebeat_imgdocker exec -it filebeat_cont bashps -ef
Describe the results you received:
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 12:55 ? 00:00:00 /usr/sbin/init
root 49 1 0 12:55 ? 00:00:00 /usr/lib/systemd/systemd-journald
root 61 1 1 12:55 ? 00:00:00 /usr/lib/systemd/systemd-udevd
dbus 88 1 0 12:55 ? 00:00:00 /usr/bin/dbus-daemon
–system --address=systemd: --nofork --nopidfile --systemd-activation
root 89 1 0 12:55 ? 00:00:00 /usr/lib/systemd/systemd-logind
root 93 1 0 12:55 tty1 00:00:00 /sbin/agetty --noclear tty1 linux
root 94 1 0 12:55 console 00:00:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 linux
root 108 0 0 12:55 pts/1 00:00:00 bash
root 122 108 0 12:55 pts/1 00:00:00 ps -ef
Describe the results you expected:
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 12:55 ? 00:00:00 /usr/sbin/init
root 49 1 0 12:55 ? 00:00:00 /usr/lib/systemd/systemd-journald
root 61 1 0 12:55 ? 00:00:00 /usr/lib/systemd/systemd-udevd
dbus 88 1 0 12:55 ? 00:00:00 /usr/bin/dbus-daemon
–system --address=systemd: --nofork --nopidfile --systemd-activation
root 89 1 0 12:55 ? 00:00:00 /usr/lib/systemd/systemd-logind
root 93 1 0 12:55 tty1 00:00:00 /sbin/agetty --noclear tty1 linux
root 94 1 0 12:55 console 00:00:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 linux
root 108 0 0 12:55 pts/1 00:00:00 bash
root 142 1 0 12:56 ? 00:00:00
/usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat.yml
-path.home /usr/share/filebeat -path.config /etc/filebeat
root 149 108 0 12:56 pts/1 00:00:00 ps -ef
Output of docker version:
[root@localhost filebeat_test]# docker -v
Docker version 18.03.0-ce, build 0520e24
Output of docker info:
[root@localhost filebeat_test]# docker info
Containers: 10
Running: 7
Paused: 0
Stopped: 3
Images: 483
Server Version: 18.03.0-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-693.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.859GiB
Name: localhost.localdomain
ID: QSFU:ODKS:LJGZ:GC34:KXTP:6B7Y:5UMB:Q7WT:V2X3:4K6M:DFLQ:I7WS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Additional environment details (AWS, VirtualBox, physical, etc.):
Running Docker in a VirtualBox