From ec2b2bcfa2c5a65a3e30b2d8985747fddc265adf Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 13 Jan 2018 10:01:06 +0000 Subject: [PATCH] tidy and fix links, add deployment.yml --- docker/netdisco-backend/Dockerfile | 2 +- docker/netdisco-base/Dockerfile | 12 ++-- docker/netdisco-base/deployment.yml | 94 +++++++++++++++++++++++++++ docker/netdisco-do/Dockerfile | 2 +- docker/netdisco-postgresql/Dockerfile | 2 +- docker/netdisco-web/Dockerfile | 2 +- 6 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 docker/netdisco-base/deployment.yml diff --git a/docker/netdisco-backend/Dockerfile b/docker/netdisco-backend/Dockerfile index 9639b4a3..002e97fa 100644 --- a/docker/netdisco-backend/Dockerfile +++ b/docker/netdisco-backend/Dockerfile @@ -1,6 +1,6 @@ # vim: ft=Dockerfile ARG TAG=master -FROM docker.io/netdisco/netdisco:${TAG}-base +FROM docker.io/netdisco/netdisco-base:${TAG}-base LABEL org.netdisco.maintainer="The Netdisco Project" LABEL org.netdisco.version=${TAG} diff --git a/docker/netdisco-base/Dockerfile b/docker/netdisco-base/Dockerfile index 3943b73f..5fe22ee3 100644 --- a/docker/netdisco-base/Dockerfile +++ b/docker/netdisco-base/Dockerfile @@ -28,19 +28,19 @@ RUN groupadd -r netdisco -g 901 && \ useradd -u 901 -r -p x -g netdisco -m -d $NETDISCO_HOME -s /bin/bash -c "netdisco user" netdisco USER netdisco:netdisco -WORKDIR $NETDISCO_HOME - -RUN curl -s https://api.github.com/repos/netdisco/netdisco/tags | \ +RUN curl -sL https://api.github.com/repos/netdisco/netdisco/tags | \ jq '.[]|.name|select(test("^\\d+\\.\\d+$"))|"https://github.com/netdisco/netdisco.git@"+.' | \ sort -rg | head -n1 | \ PERL5LIB='.' xargs -n1 cpanm --quiet --notest --local-lib $NETDISCO_HOME/perl5 -RUN mkdir $NETDISCO_HOME/bin && \ - bash -c 'ln -sf $NETDISCO_HOME/perl5/bin/{localenv,netdisco-*} $NETDISCO_HOME/bin/' +WORKDIR $NETDISCO_HOME/bin +RUN bash -c 'ln -sf $NETDISCO_HOME/perl5/bin/{localenv,netdisco-*} .' ENV PATH $NETDISCO_HOME/bin:$PATH ENV SHELL "/bin/bash" +WORKDIR $NETDISCO_HOME/environments +COPY deployment.yml . + VOLUME ["/home/netdisco/environments", "/home/netdisco/nd-site-local"] -USER netdisco:netdisco WORKDIR $NETDISCO_HOME CMD ["bash"] diff --git a/docker/netdisco-base/deployment.yml b/docker/netdisco-base/deployment.yml new file mode 100644 index 00000000..78dd7dee --- /dev/null +++ b/docker/netdisco-base/deployment.yml @@ -0,0 +1,94 @@ +# +# NETDISCO 2 CONFIGURATION FILE +# +# Settings in this file override share/config.yml +# See App::Netdisco::Manual::Configuration for more info. + +# ------------------ +# ESSENTIAL SETTINGS +# ------------------ + +database: + name: 'netdisco' + user: 'netdisco' + pass: 'netdisco' + #host: 'localhost' + +# -------------------- +# RECOMMENDED SETTINGS +# -------------------- + +# SNMP community string(s) +# ```````````````````````` +device_auth: + - tag: 'default_v2_readonly' + community: 'public' + read: true + write: false +# - tag: 'default_v2_for_write' +# community: 'private' +# read: false +# write: true + +# will be stripped from fqdn when displayed in the web UI +# also, do not forget the leading dot. +# ``````````````````````````````````````````````````````` +#domain_suffix: '.example.com' + + +# ¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸ +# ¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸ + + +# --------------------------------------------------------------- +# OTHER INTERESTING SETTINGS WHERE THE DEFAULTS ARE PROBABLY OKAY +# --------------------------------------------------------------- + +# do not discover IP Phones or Wireless Access Points. +# usually these are visible as device neighbors but don't support +# SNMP, which just clogs up the job queue. +# ``````````````````````````````````````````````````````````````` +#discover_no_type: +# - '(?i)phone' +# - '(?i)(?:wap|wireless)' + +# this is the schedule for automatically keeping netdisco up-to-date; +# these are good defaults, so only uncomment if needing to change. +# (or set "schedule: null" if you wish to disable the scheduler) +# ```````````````````````````````````````````````````````````````````` +#schedule: +# discoverall: +# when: '5 7 * * *' +# macwalk: +# when: +# min: 20 +# arpwalk: +# when: +# min: 50 +# nbtwalk: +# when: '0 8,13,21 * * *' +# expire: +# when: '30 23 * * *' + +# number of SNMP workers to run in parallel (in netdisco-backend). +# the default is twice the number of CPU cores. increase this if +# your system has few cores and the schedule is taking too long. +# ``````````````````````````````````````````````````````````````` +#workers: +# tasks: 'AUTO * 2' + +# number of parallel DNS queries for node names +# ````````````````````````````````````````````` +#dns: +# max_outstanding: 50 + +# set to true to globally disable authentication/login. +# create a user called "guest" if you want to assign port/admin rights. +# ````````````````````````````````````````````````````````````````````` +no_auth: true + +# set to false if you MUST maintain backwards compatibility +# with Netdisco 1.x web frontend. +# ````````````````````````````````````````````````````````` +#safe_password_store: true + diff --git a/docker/netdisco-do/Dockerfile b/docker/netdisco-do/Dockerfile index 3207b56d..e707019d 100644 --- a/docker/netdisco-do/Dockerfile +++ b/docker/netdisco-do/Dockerfile @@ -1,6 +1,6 @@ # vim: ft=Dockerfile ARG TAG=master -FROM docker.io/netdisco/netdisco:${TAG}-base +FROM docker.io/netdisco/netdisco-base:${TAG}-base LABEL org.netdisco.maintainer="The Netdisco Project" LABEL org.netdisco.version=${TAG} diff --git a/docker/netdisco-postgresql/Dockerfile b/docker/netdisco-postgresql/Dockerfile index 4502b86d..6bfda6b0 100644 --- a/docker/netdisco-postgresql/Dockerfile +++ b/docker/netdisco-postgresql/Dockerfile @@ -16,7 +16,7 @@ RUN chmod +x /usr/local/bin/netdisco-db-entrypoint.sh RUN PGDATA=/var/lib/postgresql/netdisco-pgdata /usr/local/bin/docker-entrypoint.sh postgres --version WORKDIR /var/lib/postgresql/netdisco-sql -RUN curl -s https://api.github.com/repos/netdisco/netdisco/tags | \ +RUN curl -sL https://api.github.com/repos/netdisco/netdisco/tags | \ jq '.[]|.name|select(test("^\\d+\\.\\d+$"))|"https://api.github.com/repos/netdisco/netdisco/tarball/"+.' | \ sort -rg | head -n1 | xargs -n1 curl -sL | \ tar --wildcards --strip-components=3 -zx '*App-Netdisco-DB-*' && \ diff --git a/docker/netdisco-web/Dockerfile b/docker/netdisco-web/Dockerfile index ecb18082..71a0a199 100644 --- a/docker/netdisco-web/Dockerfile +++ b/docker/netdisco-web/Dockerfile @@ -1,6 +1,6 @@ # vim: ft=Dockerfile ARG TAG=master -FROM docker.io/netdisco/netdisco:${TAG}-base +FROM docker.io/netdisco/netdisco-base:${TAG}-base LABEL org.netdisco.maintainer="The Netdisco Project" LABEL org.netdisco.version=${TAG}