Last active
February 22, 2017 05:57
-
-
Save rlister/94aa78329e06d82220b9c01ba5071fe7 to your computer and use it in GitHub Desktop.
Example Dockerfile for NewRelic sysmond
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox:ubuntu-14.04 | |
MAINTAINER [email protected] | |
ENV VERSION 2.3.0.132 | |
ADD https://download.newrelic.com/server_monitor/release/newrelic-sysmond-${VERSION}-linux.tar.gz . | |
RUN tar zxvf newrelic-sysmond-${VERSION}-linux.tar.gz && \ | |
rm -f newrelic-sysmond-${VERSION}-linux.tar.gz | |
WORKDIR /newrelic-sysmond-${VERSION}-linux | |
RUN mkdir -p /etc/newrelic && \ | |
mv nrsysmond.cfg /etc/newrelic/nrsysmond.cfg && \ | |
mv daemon/nrsysmond.x64 /bin/nrsysmond | |
ENV NRSYSMOND_license_key REPLACE_WITH_REAL_KEY | |
ENV NRSYSMOND_loglevel info | |
ENV NRSYSMOND_logfile /dev/stdout | |
# ENV NRSYSMOND_hostname SET_ON_CALLING_DOCKER | |
ENV NRSYSMOND_loglevel info | |
CMD ["nrsysmond", "-E", "-F"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: sysmond.service | |
command: start | |
content: |- | |
[Unit] | |
Description=Newrelic sysmond | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
TimeoutStartSec=20m | |
EnvironmentFile=/etc/environment | |
Environment=REGISTRY=12345.dkr.ecr.us-east-1.amazonaws.com | |
Environment=VERSION=2.3.0.132 | |
Environment=NRSYSMOND_license_key=d34db33f | |
ExecStartPre=-/usr/bin/docker rm %p | |
ExecStart=/usr/bin/docker run --rm \ | |
--name %p \ | |
--privileged=true \ | |
--net=host \ | |
-v /cgroup:/cgroup \ | |
-v /sys:/sys \ | |
-v /dev:/dev \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-e NRSYSMOND_license_key \ | |
-e NRSYSMOND_cgroup_style=1 \ | |
-e NRSYSMOND_hostname=%H \ | |
${REGISTRY}/nrsysmond:${VERSION} | |
ExecStopPost=/usr/bin/docker stop sysmond | |
Restart=on-failure | |
RestartSec=5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment