docker support
This commit is contained in:
parent
6366fc631e
commit
eb93d82caa
18 changed files with 370 additions and 125 deletions
20
docker/cli/Dockerfile.in
Normal file
20
docker/cli/Dockerfile.in
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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_cli.so.@CLIGEN_VERSION@ /usr/lib/
|
||||
COPY clicon_cli /usr/bin/
|
||||
RUN ldconfig
|
||||
CMD ["/usr/bin/clicon_cli", "-f", "/data/clicon.conf"]
|
||||
|
||||
|
||||
EXPOSE 7878 7878/udp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
63
docker/cli/Makefile.in
Normal file
63
docker/cli/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@
|
||||
# This is my dockerhub account
|
||||
image = olofhagsand/clicon_cli:v1.0
|
||||
|
||||
all:
|
||||
@echo "Run make docker to build docker image"
|
||||
clean:
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile *~ .depend libcli* clicon_cli clicon_backend 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_cli.so.@CLICON_VERSION_MAJOR@ .
|
||||
cp $(DESTDIR)$(bindir)/clicon_cli .
|
||||
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/cli/README
Normal file
6
docker/cli/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
|
||||
|
||||
9
docker/cli/start.sh
Executable file
9
docker/cli/start.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue