Added docker support for three restconf modes: nginx/fcgi(default); evhtp ; and none.

This commit is contained in:
Olof hagsand 2020-07-07 13:26:38 +02:00
parent 5dc2a6387d
commit 5464eec540
15 changed files with 569 additions and 95 deletions

View file

@ -31,12 +31,13 @@
#
# ***** END LICENSE BLOCK *****
#
# Clixon dockerfile without restconf
FROM alpine
MAINTAINER Olof Hagsand <olof@hagsand.se>
# For clixon and cligen
RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev
RUN apk add --update git make build-base gcc flex bison curl-dev
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
@ -57,17 +58,12 @@ RUN mkdir /clixon/clixon
WORKDIR /clixon/clixon
COPY clixon .
# Need to add www user manually
RUN adduser -D -H www-data
# nginx adds group www-data
RUN apk add --update nginx
# Configure, build and install clixon
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --with-wwwuser=www-data --enable-optyangs
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --enable-optyangs --without-restconf
RUN make
RUN make install
# Install utils
# Install utils (for tests)
WORKDIR /clixon/clixon/util
RUN make
RUN make install
@ -97,28 +93,13 @@ MAINTAINER Olof Hagsand <olof@hagsand.se>
# For clixon and cligen
RUN apk add --update flex bison fcgi-dev
# need to add www user manually
RUN adduser -D -H www-data
# nginx adds group www-data
RUN apk add --update nginx
# Test-specific (for test scripts)
RUN apk add --update sudo curl procps grep make bash
# Expose nginx port for restconf
EXPOSE 80
# Create clicon user and group
RUN adduser -D -H clicon
RUN adduser nginx clicon
RUN adduser www-data clicon
COPY --from=0 /clixon/build/ /usr/local/
COPY --from=0 /www-data /www-data
# Manually created
RUN chown www-data /www-data
RUN chgrp www-data /www-data
# Log to stderr.
CMD /usr/local/bin/startsystem.sh