docker support
This commit is contained in:
parent
6366fc631e
commit
eb93d82caa
18 changed files with 370 additions and 125 deletions
66
example/docker/Makefile.in
Normal file
66
example/docker/Makefile.in
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#
|
||||
# Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
#
|
||||
# This file is part of CLIXON.
|
||||
#
|
||||
# CLIXON is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# CLIXON is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with CLIXON; see the file LICENSE. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
prefix = @prefix@
|
||||
bindir = @bindir@
|
||||
includedir = @includedir@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
APPNAME = routing
|
||||
|
||||
all: $(APPNAME).conf
|
||||
|
||||
-include $(DESTDIR)$(datarootdir)/clicon/clicon.mk
|
||||
|
||||
# Kind of reverse install, could have copied from src dir,...
|
||||
.PHONY: docker push
|
||||
docker: $(APPNAME).conf
|
||||
install -d data
|
||||
install -d data/yang
|
||||
install -d data/backend
|
||||
install -d data/cli
|
||||
install -d data/netconf
|
||||
install -d data/clispec
|
||||
install $(APPNAME).conf data/clicon.conf # docker image assumes /data/clicon.conf
|
||||
install ../*.yang data/yang/
|
||||
install ../routing_cli.so data/cli/
|
||||
install ../routing_backend.so data/backend/
|
||||
install ../routing_netconf.so data/netconf/
|
||||
install ../*.cli data/clispec
|
||||
|
||||
clean:
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile *~ .depend
|
||||
rm -rf data
|
||||
|
||||
install:
|
||||
|
||||
uninstall:
|
||||
|
||||
install-include:
|
||||
|
||||
depend:
|
||||
$(CC) $(DEPENDFLAGS) $(INCLUDES) $(CFLAGS) -MM $(SRC) > .depend
|
||||
|
||||
#include .depend
|
||||
|
||||
8
example/docker/README
Normal file
8
example/docker/README
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Run the ietf routing example as docker container.
|
||||
Use the dockerhub container, or alternatively, build clicon as docker images
|
||||
by doing make docker in the top builddir.
|
||||
|
||||
data_dir="$(pwd)/data"
|
||||
sudo docker run -ti --rm --net host -v "$data_dir":/data olofhagsand/clicon_backend:v1.0
|
||||
|
||||
sudo docker run -ti --rm --net host -v "$data_dir":/data olofhagsand/clicon_cli:v1.0
|
||||
67
example/docker/routing.conf.local
Normal file
67
example/docker/routing.conf.local
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Main YANG module first parsed by parser (in CLICON_YANG_DIR). eg clicon.yang.
|
||||
|
||||
# Location of configuration-file for default values (this file)
|
||||
CLICON_CONFIGFILE /data/clicon.conf
|
||||
# Location of YANG module and submodule files. Only if CLICON_DBSPEC_TYPE is YANG
|
||||
CLICON_YANG_DIR /data/yang
|
||||
# Option used to construct initial yang file:
|
||||
# <module>[@<revision>]
|
||||
# This option is only relevant if CLICON_DBSPEC_TYPE is YANG
|
||||
# CLICON_YANG_MODULE_MAIN clicon
|
||||
# Option used to construct initial yang file:
|
||||
# <module>[@<revision>]
|
||||
# This option is only relevant if CLICON_DBSPEC_TYPE is YANG
|
||||
CLICON_YANG_MODULE_REVISION
|
||||
# Candidate qdbm database
|
||||
CLICON_CANDIDATE_DB /data/candidate_db
|
||||
# Running qdbm database
|
||||
CLICON_RUNNING_DB /data/running_db
|
||||
# Location of backend .so plugins
|
||||
CLICON_BACKEND_DIR /data/backend
|
||||
# Location of netconf (frontend) .so plugins
|
||||
CLICON_NETCONF_DIR /data/netconf
|
||||
# Location of cli frontend .so plugins
|
||||
CLICON_CLI_DIR /data/cli
|
||||
# Location of frontend .cli cligen spec files
|
||||
CLICON_CLISPEC_DIR /data/clispec
|
||||
# Directory where to save configuration commit history (in XML). Snapshots
|
||||
# are saved chronologically
|
||||
CLICON_ARCHIVE_DIR /data
|
||||
# XXX Name of startup configuration file (in XML)
|
||||
CLICON_STARTUP_CONFIG /data/startup-config
|
||||
# Address family for communicating with clicon_backend (UNIX|IPv4|IPv6)
|
||||
CLICON_SOCK_FAMILY UNIX
|
||||
# If family above is AF_UNIX: Unix socket for communicating with clicon_backend
|
||||
# If family above is AF_INET: IPv4 address
|
||||
CLICON_SOCK /data/routing.sock
|
||||
# Inet socket port for communicating with clicon_backend (only IPv4|IPv6)
|
||||
CLICON_SOCK_PORT 4535
|
||||
# Process-id file
|
||||
CLICON_BACKEND_PIDFILE /data/routing.pidfile
|
||||
|
||||
|
||||
# Save values as XML in database instead of lvec:s.
|
||||
# This is optimized for yang specified applications
|
||||
# But not compatible with key-based application (eg Rost)
|
||||
CLICON_DB_XML 1
|
||||
|
||||
# Startup CLI mode. This should match the CLICON_MODE in your startup clispec file
|
||||
CLICON_CLI_MODE routing
|
||||
|
||||
# Option used to construct initial yang file:
|
||||
# <module>[@<revision>]
|
||||
# This option is only relevant if CLICON_DBSPEC_TYPE is YANG
|
||||
CLICON_YANG_MODULE_MAIN ietf-ip
|
||||
|
||||
# Option used to construct initial yang file:
|
||||
# <module>[@<revision>]
|
||||
# This option is only relevant if CLICON_DBSPEC_TYPE is YANG
|
||||
CLICON_YANG_MODULE_REVISION 2014-06-16
|
||||
|
||||
# Generate code for CLI completion of existing db symbols
|
||||
# CLICON_CLI_GENMODEL_COMPLETION 0
|
||||
CLICON_CLI_GENMODEL_COMPLETION 1
|
||||
|
||||
# How to generate and show CLI syntax: VARS|ALL
|
||||
# CLICON_CLI_GENMODEL_TYPE VARS
|
||||
CLICON_CLI_GENMODEL_TYPE VARS
|
||||
Loading…
Add table
Add a link
Reference in a new issue