docker netconf
This commit is contained in:
parent
cd0883ba95
commit
baa5611616
12 changed files with 103 additions and 19 deletions
4
configure
vendored
4
configure
vendored
|
|
@ -4191,7 +4191,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clicon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/dbctrl/Makefile include/Makefile etc/Makefile etc/cliconrc example/Makefile example/docker/Makefile docker/Makefile docker/cli/Makefile docker/cli/Dockerfile docker/backend/Makefile docker/backend/Dockerfile doc/Makefile"
|
ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clicon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/dbctrl/Makefile include/Makefile etc/Makefile etc/cliconrc example/Makefile example/docker/Makefile docker/Makefile docker/cli/Makefile docker/cli/Dockerfile docker/backend/Makefile docker/backend/Dockerfile docker/netconf/Makefile docker/netconf/Dockerfile doc/Makefile"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
|
|
@ -4903,6 +4903,8 @@ do
|
||||||
"docker/cli/Dockerfile") CONFIG_FILES="$CONFIG_FILES docker/cli/Dockerfile" ;;
|
"docker/cli/Dockerfile") CONFIG_FILES="$CONFIG_FILES docker/cli/Dockerfile" ;;
|
||||||
"docker/backend/Makefile") CONFIG_FILES="$CONFIG_FILES docker/backend/Makefile" ;;
|
"docker/backend/Makefile") CONFIG_FILES="$CONFIG_FILES docker/backend/Makefile" ;;
|
||||||
"docker/backend/Dockerfile") CONFIG_FILES="$CONFIG_FILES docker/backend/Dockerfile" ;;
|
"docker/backend/Dockerfile") CONFIG_FILES="$CONFIG_FILES docker/backend/Dockerfile" ;;
|
||||||
|
"docker/netconf/Makefile") CONFIG_FILES="$CONFIG_FILES docker/netconf/Makefile" ;;
|
||||||
|
"docker/netconf/Dockerfile") CONFIG_FILES="$CONFIG_FILES docker/netconf/Dockerfile" ;;
|
||||||
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
|
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
|
||||||
|
|
||||||
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,8 @@ AC_OUTPUT(Makefile
|
||||||
docker/cli/Dockerfile
|
docker/cli/Dockerfile
|
||||||
docker/backend/Makefile
|
docker/backend/Makefile
|
||||||
docker/backend/Dockerfile
|
docker/backend/Dockerfile
|
||||||
|
docker/netconf/Makefile
|
||||||
|
docker/netconf/Dockerfile
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ LIBS = @LIBS@
|
||||||
|
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
|
|
||||||
SUBDIRS = cli backend
|
SUBDIRS = cli backend netconf
|
||||||
|
|
||||||
.PHONY: all clean depend install $(SUBDIRS) docker push
|
.PHONY: all clean depend install $(SUBDIRS) docker push
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
This dir contains docker code - how to build clixon as docker containers
|
This dir contains docker code - how to build clixon as docker containers
|
||||||
cli Build olofhagsand/clicon_cli container
|
cli Build olofhagsand/clixon_cli container
|
||||||
backend Build olofhagsand/clicon_backend container
|
backend Build olofhagsand/clixon_backend container
|
||||||
|
netconf Build olofhagsand/clixon_netconf container
|
||||||
|
|
||||||
|
Perform the build by 'make docker'.
|
||||||
|
You may also do 'make push' if you want to push the image, but you may then consider changing the image name (in the makefile:s).
|
||||||
|
|
||||||
You may run the container directly by going directly to example and
|
You may run the container directly by going directly to example and
|
||||||
the docker runtime scripts there
|
the docker runtime scripts there
|
||||||
|
|
@ -11,7 +11,6 @@ RUN ldconfig
|
||||||
RUN sudo groupadd clicon
|
RUN sudo groupadd clicon
|
||||||
CMD ["/usr/sbin/clicon_backend", "-D", "1", "-F", "-f", "/data/clicon.conf"]
|
CMD ["/usr/sbin/clicon_backend", "-D", "1", "-F", "-f", "/data/clicon.conf"]
|
||||||
|
|
||||||
EXPOSE 7878 7878/udp
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ sbindir = @sbindir@
|
||||||
libdir = @libdir@
|
libdir = @libdir@
|
||||||
includedir = @includedir@
|
includedir = @includedir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
# You may consider changing this
|
||||||
image = olofhagsand/clicon_backend
|
image = olofhagsand/clicon_backend
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
@ -35,7 +36,7 @@ all:
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f Makefile *~ .depend libcli* clicon_cli clicon_backend Dockerfile
|
rm -f Makefile *~ .depend libcligen* libclicon* clicon_backend Dockerfile
|
||||||
|
|
||||||
# Kind of reverse install, could have copied from src dir,...
|
# Kind of reverse install, could have copied from src dir,...
|
||||||
.PHONY: docker push
|
.PHONY: docker push
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ RUN ldconfig
|
||||||
CMD ["/usr/bin/clicon_cli", "-f", "/data/clicon.conf"]
|
CMD ["/usr/bin/clicon_cli", "-f", "/data/clicon.conf"]
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 7878 7878/udp
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ sbindir = @sbindir@
|
||||||
libdir = @libdir@
|
libdir = @libdir@
|
||||||
includedir = @includedir@
|
includedir = @includedir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
# This is my dockerhub account
|
# You may consider changing this
|
||||||
image = olofhagsand/clicon_cli
|
image = olofhagsand/clicon_cli
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
@ -36,7 +36,7 @@ all:
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f Makefile *~ .depend libcli* clicon_cli clicon_backend Dockerfile
|
rm -f Makefile *~ .depend libcligen* libclicon* clicon_cli Dockerfile
|
||||||
|
|
||||||
# Kind of reverse install, could have copied from src dir,...
|
# Kind of reverse install, could have copied from src dir,...
|
||||||
.PHONY: docker push
|
.PHONY: docker push
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Script reads yang spec from stdin then start clicon_cli
|
|
||||||
read -d $'\cd' -p "input yang spec(end with ^d). Or just ^d for default spec> " spec
|
|
||||||
if [ "$spec" != "" ]; then
|
|
||||||
echo "module datamodel{" > /usr/local/share/clicon_yang/yang/clicon_yang.yang
|
|
||||||
echo $spec >> /usr/local/share/clicon_yang/yang/clicon_yang.yang
|
|
||||||
echo "}" >> /usr/local/share/clicon_yang/yang/clicon_yang.yang
|
|
||||||
fi
|
|
||||||
clicon_cli -cf /usr/local/etc/clicon_yang.conf
|
|
||||||
18
docker/netconf/Dockerfile.in
Normal file
18
docker/netconf/Dockerfile.in
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
FROM ubuntu:14.04
|
||||||
|
# 12.04
|
||||||
|
MAINTAINER Olof Hagsand <olof@hagsand.se>
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
RUN apt-get update && apt-get install -y libqdbm-dev
|
||||||
|
COPY libcligen.so.@CLIGEN_VERSION@ /usr/lib/
|
||||||
|
COPY libclicon.so.@CLICON_VERSION_MAJOR@ /usr/lib/
|
||||||
|
COPY libclicon_netconf.so.@CLIGEN_VERSION@ /usr/lib/
|
||||||
|
COPY clicon_netconf /usr/bin/
|
||||||
|
RUN ldconfig
|
||||||
|
CMD ["/usr/bin/clicon_netconf", "-f", "/data/clicon.conf"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
63
docker/netconf/Makefile.in
Normal file
63
docker/netconf/Makefile.in
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
#
|
||||||
|
# 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@
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
bindir = @bindir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
libdir = @libdir@
|
||||||
|
includedir = @includedir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
# You may consider changing this
|
||||||
|
image = olofhagsand/clicon_netconf
|
||||||
|
|
||||||
|
all:
|
||||||
|
@echo "Run make docker to build docker image"
|
||||||
|
clean:
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f Makefile *~ .depend libcligen* libclicon* clicon_netconf Dockerfile
|
||||||
|
|
||||||
|
# Kind of reverse install, could have copied from src dir,...
|
||||||
|
.PHONY: docker push
|
||||||
|
docker:
|
||||||
|
cp $(DESTDIR)$(libdir)/libcligen.so.@CLIGEN_VERSION@ .
|
||||||
|
cp $(DESTDIR)$(libdir)/libclicon.so.@CLICON_VERSION_MAJOR@ .
|
||||||
|
cp $(DESTDIR)$(libdir)/libclicon_netconf.so.@CLICON_VERSION_MAJOR@ .
|
||||||
|
cp $(DESTDIR)$(bindir)/clicon_netconf .
|
||||||
|
sudo docker build -t $(image) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
sudo docker push $(image)
|
||||||
|
|
||||||
|
install:
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
|
||||||
|
install-include:
|
||||||
|
|
||||||
|
depend:
|
||||||
|
# $(CC) $(DEPENDFLAGS) $(INCLUDES) $(CFLAGS) -MM $(SRC) > .depend
|
||||||
|
|
||||||
|
#include .depend
|
||||||
|
|
||||||
6
docker/netconf/README
Normal file
6
docker/netconf/README
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
Ensure that cligen and clicon has been built and installed.
|
||||||
|
sudo make docker
|
||||||
|
make push
|
||||||
|
|
||||||
|
Then go to example and run the example as a docker container
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue