er image build and changed it to build a single clixon docker\

image which can be found at olofhagsand/clixon
This commit is contained in:
Olof Hagsand 2018-07-21 13:55:21 +00:00
parent deb89600ed
commit c7aed5e7a7
17 changed files with 70 additions and 418 deletions

View file

@ -31,19 +31,38 @@
# ***** END LICENSE BLOCK *****
#
FROM ubuntu:14.04
# 12.04
FROM debian
MAINTAINER Olof Hagsand <olof@hagsand.se>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y libqdbm-dev
RUN apt-get update && apt-get install -y \
git make gcc flex bison
RUN groupadd clicon
COPY libcligen.so.@CLIGEN_VERSION@ /usr/lib/
COPY libclixon.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY libclixon_cli.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY clixon_cli /usr/bin/
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
WORKDIR /clixon
# Clone cligen and clixon
RUN git clone https://github.com/olofhagsand/cligen.git
RUN git clone https://github.com/clicon/clixon.git
# Build cligen
WORKDIR /clixon/cligen
RUN ./configure
RUN make
RUN make install
# Build clixon
WORKDIR /clixon/clixon
RUN git checkout -b develop origin/develop
RUN ./configure --without-restconf
RUN make
RUN make install
RUN make install-include
#RUN rm -rf /clixon
RUN ldconfig
CMD ["/usr/bin/clixon_cli", "-f", "/data/clixon.conf"]

View file

@ -38,46 +38,33 @@ CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
# Change this
IMAGE = olofhagsand/clixon
SHELL = /bin/sh
SUBDIRS = cli backend netconf
.PHONY: all clean depend install $(SUBDIRS) docker push
.PHONY: all clean depend install docker push
all: $(SUBDIRS)
depend:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
$(SUBDIRS):
(cd $@; $(MAKE) $(MFLAGS) all)
install-include:
for i in $(SUBDIRS); \
do (cd $$i ; $(MAKE) $(MFLAGS) $@); done;
install:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
uninstall:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
all:
@echo "Run make docker to build docker image"
clean:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
distclean: clean
rm -f Makefile *~ .depend
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
docker:
for i in $(SUBDIRS); \
do (cd $$i && $(MAKE) $(MFLAGS) $@); done
sudo docker build -t $(IMAGE) .
push:
for i in $(SUBDIRS); \
do (cd $$i && $(MAKE) $(MFLAGS) $@); done
sudo docker push $(IMAGE)
depend:
install-include:
install:
uninstall:

View file

@ -1,12 +0,0 @@
This dir is not updated
This dir contains docker code - how to build clixon as docker containers
cli Build olofhagsand/clixon_cli 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
the docker runtime scripts there

19
docker/README.md Normal file
View file

@ -0,0 +1,19 @@
# Clixon base docker image
This directory contains code for building and pushing a Clixon docker
container. By default it is pushed to olofhagsand/clixon, but you can change
the IMAGE in Makefile.in and push it to another name.
The clixon docker image is a base image that can be used to build
clixon applications. It has all the whole code for a clixon release
which it downloads from git - it does not use local code.
See example/docker for how to build a docker application using the base image.
Build and push
==============
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
the docker runtime scripts there

View file

@ -1,53 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
#
# This file is part of CLIXON
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"),
# in which case the provisions of the GPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of the GPL, and not to allow others to
# use your version of this file under the terms of Apache License version 2,
# indicate your decision by deleting the provisions above and replace them with
# the notice and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the Apache License version 2 or the GPL.
#
# ***** END LICENSE BLOCK *****
#
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
RUN groupadd clicon
COPY libcligen.so.@CLIGEN_VERSION@ /usr/lib/
COPY libclixon.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY libclixon_backend.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY clixon_backend /usr/sbin/
RUN ldconfig
RUN sudo groupadd clixon
CMD ["/usr/sbin/clixon_backend", "-F", "-f", "/data/clixon.conf"]

View file

@ -1,77 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
#
# This file is part of CLIXON
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"),
# in which case the provisions of the GPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of the GPL, and not to allow others to
# use your version of this file under the terms of Apache License version 2,
# indicate your decision by deleting the provisions above and replace them with
# the notice and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the Apache License version 2 or the GPL.
#
# ***** END LICENSE BLOCK *****
#
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/clixon_backend
all:
@echo "Run make docker to build docker image"
clean:
distclean: clean
rm -f Makefile *~ .depend libcligen* libclixon* clixon_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)/libclixon.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(libdir)/libclixon_backend.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(sbindir)/clixon_backend .
sudo docker build -t $(image) .
push:
docker push $(image)
install:
uninstall:
install-include:
depend:
# $(CC) $(DEPENDFLAGS) $(INCLUDES) $(CFLAGS) -MM $(SRC) > .depend
#include .depend

View file

@ -1,6 +0,0 @@
Ensure that cligen and clixon has been built and installed.
sudo make docker
make push
Then go to example and run the example as a docker container

View file

@ -1,76 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
#
# This file is part of CLIXON
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"),
# in which case the provisions of the GPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of the GPL, and not to allow others to
# use your version of this file under the terms of Apache License version 2,
# indicate your decision by deleting the provisions above and replace them with
# the notice and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the Apache License version 2 or the GPL.
#
# ***** END LICENSE BLOCK *****
#
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/clixon_cli
all:
@echo "Run make docker to build docker image"
clean:
distclean: clean
rm -f Makefile *~ .depend libcligen* libclixon* clixon_cli 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)/libclixon.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(libdir)/libclixon_cli.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(bindir)/clixon_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

View file

@ -1,6 +0,0 @@
Ensure that cligen and clixon has been built and installed.
sudo make docker
make push
Then go to example and run the example as a docker container

View file

@ -1,52 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
#
# This file is part of CLIXON
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"),
# in which case the provisions of the GPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of the GPL, and not to allow others to
# use your version of this file under the terms of Apache License version 2,
# indicate your decision by deleting the provisions above and replace them with
# the notice and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the Apache License version 2 or the GPL.
#
# ***** END LICENSE BLOCK *****
#
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
RUN groupadd clicon
COPY libcligen.so.@CLIGEN_VERSION@ /usr/lib/
COPY libclixon.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY libclixon_netconf.so.@CLIXON_VERSION_MAJOR@ /usr/lib/
COPY clixon_netconf /usr/bin/
RUN ldconfig
CMD ["/usr/bin/clixon_netconf", "-f", "/data/clixon.conf"]

View file

@ -1,76 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
#
# This file is part of CLIXON
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"),
# in which case the provisions of the GPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of the GPL, and not to allow others to
# use your version of this file under the terms of Apache License version 2,
# indicate your decision by deleting the provisions above and replace them with
# the notice and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the Apache License version 2 or the GPL.
#
# ***** END LICENSE BLOCK *****
#
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/clixon_netconf
all:
@echo "Run make docker to build docker image"
clean:
distclean: clean
rm -f Makefile *~ .depend libcligen* libclixon* clixon_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)/libclixon.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(libdir)/libclixon_netconf.so.@CLIXON_VERSION_MAJOR@ .
cp $(DESTDIR)$(bindir)/clixon_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

View file

@ -1,6 +0,0 @@
Ensure that cligen and clixon has been built and installed.
sudo make docker
make push
Then go to example and run the example as a docker container