fiblebeatdockerfile解读

ADD file:074f2c974463ab38cf3532134e8ba2c91c9e346457713f2e8b8e2ac0ee9fd83d in /

LABEL org.label-schema.schema-version=1.0 org.label-schema.name=CentOS Base Image org.label-schema.vendor=CentOS org.label-schema.license=GPLv2 org.label-schema.build-date=20190305

CMD ["/bin/bash"]

LABEL org.label-schema.schema-version=1.0 org.label-schema.vendor=Elastic org.label-schema.name=filebeat org.label-schema.version=7.1.1 org.label-schema.url=https://www.elastic.co/products/beats/filebeat org.label-schema.vcs-url=github.com/elastic/beats org.label-schema.vcs-ref=3358d9a5a09e3c6709a2d3aaafde628ea34e8419 license=Elastic License description=Filebeat sends log files to Logstash or directly to Elasticsearch.

ENV ELASTIC_CONTAINER=true

ENV PATH=/usr/share/filebeat:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

COPY dir:417682e86cf94aa0f157201ee06980e1f35d8f27925b2c960100de170540315b in /usr/share/filebeat

COPY file:18ce723a900496da8559af46a19f2693f6d7d7dc3fe1836812ffb74d634247ae in /usr/local/bin/docker-entrypoint

RUN chmod 755 /usr/local/bin/docker-entrypoint

RUN groupadd --gid 1000 filebeat

RUN mkdir /usr/share/filebeat/data /usr/share/filebeat/logs && chown -R root:filebeat /usr/share/filebeat && find /usr/share/filebeat -type d -exec chmod 0750 {} \; && find /usr/share/filebeat -type f -exec chmod 0640 {} \; && chmod 0750 /usr/share/filebeat/filebeat && chmod 0770 /usr/share/filebeat/modules.d && chmod 0770 /usr/share/filebeat/data /usr/share/filebeat/logs
# 新建filebeat用户 指定用户id 组id 1000(普通用户 uid=0为root用户)   --home(或者-d) 指定filebeat用户家目录
RUN useradd -M --uid 1000 --gid 1000 --home /usr/share/filebeat filebeat
# 改变之后层的命令的用户
USER filebeat

WORKDIR /usr/share/filebeat

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["-e"]



这个镜像规定了指定的filebeat用户,在用户家目录下用户拥有root权限,所以如果配置文件放在家目录之外,是执行不了的
 CMD filebeat -c /etc/filbeat/filebeat.yml -e  windows  #格式自己调哈
我自己是开发,这个笔记对我主要的作用是让我认识了自己运维知识及命令细节参数的不足

posted on 2020-12-14 19:33  小胖子方法  阅读(177)  评论(0编辑  收藏  举报

导航