如何在 ubuntu 容器上安装 Insightops(log-entries) A​​gent

How to install Insightops(log-entries ) Agent on ubuntu container

我正在尝试在 Docker 中安装和设置 insightops(log-entries) Linux 代理以在容器中使用 log-entries 代理

添加Docker文件-

FROM ubuntu:16.04
RUN apt-get update -y
COPY Linux_Insight_Agent/ /app/
RUN chmod u+x /app/agent_installer.sh
RUN ./app/agent_installer.sh install_start

在构建图像时它向我抛出错误 ------------------------------ ----------

Installing systemd service [INFO]
Failed to connect to bus: No such file or directory
Configuration file /etc/systemd/system/ir_agent.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Created symlink /etc/systemd/system/default.target.wants/ir_agent.service, pointing to /etc/systemd/system/ir_agent.service.

任何人都可以帮助我,如果需要在 docker 容器上设置它,请建议我另一种方式。

注意:我不想使用 insightops(log-entries) docker 代理。

随后的文档:https://insightops.help.rapid7.com/v1.0/docs/insight-agent-on-linux

要解决此问题,我们需要为完整容器功能添加特权标志并在容器上启动 init 进程

正在添加 docker 文件:

FROM ubuntu:latest
#To start init process in container on runtime
ENTRYPOINT  ["/sbin/init"]
COPY ./Linux_Insight_Agent/Linux_Insight_Agent
RUN chmod -R 755 /Linux_Insight_Agent
#Install and start the Agent on container
RUN /Linux_Insight_Agent/agent_installer.sh install
RUN /Linux_Insight_Agent/agent_installer.sh start

撰写文件:

 version: "2" 
    services:
      le:
        build:
          context: ./
          dockerfile: Dockerfile
        image: test-le:latest
        privileged: true
        restart: always
        volumes:
         - /var/log:/rest/out

使用以下命令

构建并运行图像
docker-compose -f docker-compose.yml up -d

它将在容器中使用 运行ning Linux 代理重新启动容器