FROM centos:centos7.9.2009
ARG NODE_EXPORTER_HOME=/usr/local/node-exporter
COPY ./node_exporter-1.7.0.linux-amd64.tar.gz /opt
RUN mkdir -p ${NODE_EXPORTER_HOME} RUN tar -xzvf /opt/node_exporter-1.7.0.linux-amd64.tar.gz -C /usr/local/node-exporter --strip-components=1
RUN groupadd -r node_exporter && \ useradd -g node_exporter -s /bin/bash -c "node_exporter user" node_exporter && \ chown -R node_exporter:node_exporter /usr/local/node-exporter
EXPOSE 9100
WORKDIR ${NODE_EXPORTER_HOME}
USER node_exporter
ENTRYPOINT [ "./node_exporter" ]
|