diff --git a/Makefile.in b/Makefile.in index 933883d3..91ffa28f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,7 +49,7 @@ $(SUBDIRS): (cd $@ && $(MAKE) $(MFLAGS) all) depend: - for i in $(SUBDIRS) doc example; \ + for i in $(SUBDIRS) doc example docker; \ do (cd $$i && $(MAKE) $(MFLAGS) depend); done # template clixon.conf file @@ -73,7 +73,7 @@ install-include: echo "To install example app: cd example; make; make install" uninstall: - for i in $(SUBDIRS) doc example; \ + for i in $(SUBDIRS) doc example docker; \ do (cd $$i && $(MAKE) $(MFLAGS) $@); done; rm -f $(datadir)/clixon/clixon.conf.cpp rm -f $(datadir)/clixon/clixon.mk @@ -88,14 +88,14 @@ configure: configure.ac cd $(srcdir) && autoconf clean: - for i in $(SUBDIRS) doc example; \ + for i in $(SUBDIRS) doc example docker; \ do (cd $$i && $(MAKE) $(MFLAGS) $@); done; distclean: rm -f Makefile TAGS config.status config.log *~ .depend rm -rf Makefile autom4te.cache rm -rf clixon.conf.cpp clixon.mk - for i in $(SUBDIRS) doc example; \ + for i in $(SUBDIRS) doc example docker; \ do (cd $$i && $(MAKE) $(MFLAGS) $@); done docker: diff --git a/apps/backend/Makefile.in b/apps/backend/Makefile.in index e36d7645..f31ec42f 100644 --- a/apps/backend/Makefile.in +++ b/apps/backend/Makefile.in @@ -75,7 +75,7 @@ clean: rm -f *.core $(APPL) $(APPOBJ) $(LIBOBJ) $(MYLIB) $(MYLIBSO) $(MYLIBLINK) distclean: clean - rm -f Makefile *~ .depend + rm -f Makefile *~ .depend test test.c # Put demon in bin # Put other executables in libexec/ diff --git a/apps/cli/Makefile.in b/apps/cli/Makefile.in index a6e5b421..5e7a2d0f 100644 --- a/apps/cli/Makefile.in +++ b/apps/cli/Makefile.in @@ -71,7 +71,7 @@ clean: rm -f $(OBJS) $(LIBOBJS) *.core $(APPL) $(MYLIB) $(MYLIBSO) $(MYLIBLINK) distclean: clean - rm -f Makefile *~ .depend + rm -f Makefile *~ .depend test test.c # Put daemon in bin # Put other executables in libexec/ diff --git a/example/Makefile.in b/example/Makefile.in index cb7f3ca4..87528060 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -77,9 +77,11 @@ OBJS = $(BE_OBJ) $(CLI_OBJ) $(NETCONF_OBJ) clean: rm -f $(PLUGINS) $(OBJS) $(APPNAME).conf + (cd docker && $(MAKE) $(MFLAGS) $@) distclean: clean rm -f Makefile *~ .depend + (cd docker && $(MAKE) $(MFLAGS) $@) install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(APPNAME).conf install -d $(DESTDIR)$(clixon_SYSCONFDIR) @@ -95,17 +97,20 @@ install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $ install -d $(DESTDIR)$(clixon_LIBDIR)/clispec install $(CLISPECS) $(DESTDIR)$(clixon_LIBDIR)/clispec; install -d $(DESTDIR)$(clixon_LOCALSTATEDIR) + (cd docker && $(MAKE) $(MFLAGS) $@) uninstall: rm -rf $(DESTDIR)$(clixon_SYSCONFDIR)/$(APPNAME).conf rm -rf $(DESTDIR)$(clixon_DBSPECDIR) rm -rf $(DESTDIR)$(clixon_LOCALSTATEDIR) rm -rf $(DESTDIR)$(clixon_LIBDIR) + (cd docker && $(MAKE) $(MFLAGS) $@) install-include: depend: $(CC) $(DEPENDFLAGS) $(INCLUDES) $(CFLAGS) -MM $(SRC) > .depend + (cd docker && $(MAKE) $(MFLAGS) $@) #include .depend diff --git a/example/docker/README b/example/docker/README index 0bcbe585..59a84417 100644 --- a/example/docker/README +++ b/example/docker/README @@ -2,7 +2,5 @@ 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 \ No newline at end of file + make docker # Create shared file system + run.sh # Run a backend and a cli diff --git a/example/docker/run.sh b/example/docker/run.sh new file mode 100755 index 00000000..e1f703d4 --- /dev/null +++ b/example/docker/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Start daemon and a cli docker containers . +# Note that they have a common file-system at /data +# +sudo docker run -td --net host -v $(pwd)/data:/data olofhagsand/clicon_backend +sudo docker run -ti --rm --net host -v $(pwd)/data:/data olofhagsand/clicon_cli + +