Adjust Dockerfiles after changing --with-cligen

configure --with-cligen parameter was changed to respect common
variables like prefix, includedir and libdir.  Modify all Dockerfiles
accordingly to make sure tests keep working
This commit is contained in:
Renato Botelho do Couto 2023-07-06 13:08:05 +00:00
parent f2b8a8045f
commit 753d20a691
4 changed files with 61 additions and 75 deletions

View file

@ -42,10 +42,8 @@ RUN apk add --update git make build-base gcc flex bison curl-dev
# For netsnmp
RUN apk add --update net-snmp net-snmp-dev
WORKDIR /usr/local/share
# Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang
RUN mkdir -p /usr/local/share/yang
WORKDIR /usr/local/share/yang
@ -56,12 +54,10 @@ RUN git config core.sparseCheckout true
RUN echo "standard/" >> .git/info/sparse-checkout
RUN echo "experimental/" >> .git/info/sparse-checkout
WORKDIR /usr/local/share/yang
RUN git pull origin main
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
RUN mkdir /clixon/build
RUN mkdir -p /clixon/build
WORKDIR /clixon
# Clone cligen
@ -69,9 +65,9 @@ RUN git clone https://github.com/clicon/cligen.git
# Build cligen
WORKDIR /clixon/cligen
RUN ./configure --prefix=/clixon/build
RUN ./configure --prefix=/usr/local
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Copy Clixon from local dir
RUN mkdir /clixon/clixon
@ -79,29 +75,26 @@ WORKDIR /clixon/clixon
COPY clixon .
# Configure, build and install clixon
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --without-restconf --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN ./configure --prefix=/usr/local --with-cligen=/clixon/build --without-restconf --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Install utils (for tests)
WORKDIR /clixon/clixon/util
RUN make
RUN make install
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Copy tests
WORKDIR /clixon/clixon/test
RUN install -d /clixon/build/bin/test
RUN install *.sh /clixon/build/bin/test
RUN install *.exp /clixon/build/bin/test
RUN install clixon.png /clixon/build/bin/test
RUN install -d /clixon/build/usr/local/bin/test
RUN install *.sh /clixon/build/usr/local/bin/test
RUN install *.exp /clixon/build/usr/local/bin/test
RUN install clixon.png /clixon/build/usr/local/bin/test
# Copy startscript
WORKDIR /clixon
COPY startsystem.sh startsystem.sh
RUN install startsystem.sh /clixon/build/bin/
RUN install startsystem.sh /clixon/build/usr/local/bin/
# Add our generated YANG files
RUN git clone https://github.com/clicon/mib-yangs.git /usr/local/share/mib-yangs
@ -131,7 +124,7 @@ RUN apk add --update sudo curl procps grep make bash expect
# Create clicon user and group
RUN adduser -D -H clicon
COPY --from=0 /clixon/build/ /usr/local/
COPY --from=0 /clixon/build/ /
COPY --from=0 /usr/local/share/yang/ /usr/local/share/yang/
COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/

View file

@ -41,32 +41,28 @@ RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev
# For netsnmp
RUN apk add --update net-snmp net-snmp-dev
# Checkut models
WORKDIR /usr/local/share/
# Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang
RUN mkdir -p /usr/local/share/yang
WORKDIR /usr/local/share/yang
RUN git config --global init.defaultBranch master
RUN git init;
RUN git remote add -f origin https://github.com/YangModels/yang;
RUN git init
RUN git remote add -f origin https://github.com/YangModels/yang
RUN git config core.sparseCheckout true
RUN echo "standard/" >> .git/info/sparse-checkout
RUN echo "experimental/" >> .git/info/sparse-checkout
RUN git pull origin main
RUN mkdir /usr/local/share/openconfig
RUN mkdir -p /usr/local/share/openconfig
WORKDIR /usr/local/share/openconfig
# Checkut Openconfig models for tests
RUN git clone https://github.com/openconfig/public
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
RUN mkdir /clixon/build
RUN mkdir -p /clixon/build
WORKDIR /clixon
# Clone cligen
@ -74,12 +70,12 @@ RUN git clone https://github.com/clicon/cligen.git
# Build cligen
WORKDIR /clixon/cligen
RUN ./configure --prefix=/clixon/build
RUN ./configure --prefix=/usr/local --sysconfdir=/etc
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Copy Clixon from local dir
RUN mkdir /clixon/clixon
RUN mkdir -p /clixon/clixon
WORKDIR /clixon/clixon
COPY clixon .
@ -89,27 +85,28 @@ RUN adduser -D -H -G www-data www-data
RUN apk add --update nginx
# Configure, build and install clixon
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --with-restconf=fcgi --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build --with-restconf=fcgi --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Install utils (for tests)
WORKDIR /clixon/clixon/util
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Build and install the clixon example
WORKDIR /clixon/clixon/example/main
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
RUN mkdir -p /clixon/build/etc
RUN install example.xml /clixon/build/etc/clixon.xml
# Copy tests
WORKDIR /clixon/clixon/test
RUN install -d /clixon/build/bin/test
RUN install *.sh /clixon/build/bin/test
RUN install *.exp /clixon/build/bin/test
RUN install clixon.png /clixon/build/bin/test
RUN install -d /clixon/build/usr/local/bin/test
RUN install *.sh /clixon/build/usr/local/bin/test
RUN install *.exp /clixon/build/usr/local/bin/test
RUN install clixon.png /clixon/build/usr/local/bin/test
RUN install -d /clixon/build/mibs
RUN install mibs/* /clixon/build/mibs
@ -117,7 +114,7 @@ RUN install mibs/* /clixon/build/mibs
# Copy startscript
WORKDIR /clixon
COPY startsystem_fcgi.sh startsystem.sh
RUN install startsystem.sh /clixon/build/bin/
RUN install startsystem.sh /clixon/build/usr/local/bin/
# Add our generated YANG files
RUN git clone https://github.com/clicon/mib-yangs.git /usr/local/share/mib-yangs
@ -157,7 +154,7 @@ RUN adduser -D -H clicon
RUN adduser nginx clicon
RUN adduser www-data clicon
COPY --from=0 /clixon/build/ /usr/local/
COPY --from=0 /clixon/build/ /
COPY --from=0 /usr/local/share/yang/ /usr/local/share/yang/
COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/
COPY --from=0 /clixon/build/mibs/* /usr/share/snmp/mibs/

View file

@ -44,32 +44,28 @@ RUN apk add --update nghttp2
# For netsnmp
RUN apk add --update net-snmp net-snmp-dev
# Checkut models
WORKDIR /usr/local/share/
# Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang
RUN mkdir -p /usr/local/share/yang
WORKDIR /usr/local/share/yang
RUN git config --global init.defaultBranch master
RUN git init;
RUN git remote add -f origin https://github.com/YangModels/yang;
RUN git init
RUN git remote add -f origin https://github.com/YangModels/yang
RUN git config core.sparseCheckout true
RUN echo "standard/" >> .git/info/sparse-checkout
RUN echo "experimental/" >> .git/info/sparse-checkout
RUN git pull origin main
RUN mkdir /usr/local/share/openconfig
RUN mkdir -p /usr/local/share/openconfig
WORKDIR /usr/local/share/openconfig
# Checkut Openconfig models for tests
RUN git clone https://github.com/openconfig/public
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
RUN mkdir /clixon/build
RUN mkdir -p /clixon/build
WORKDIR /clixon
# Clone cligen
@ -77,41 +73,42 @@ RUN git clone https://github.com/clicon/cligen.git
# Build cligen
WORKDIR /clixon/cligen
RUN ./configure --prefix=/clixon/build
RUN ./configure --prefix=/usr/local --sysconfdir=/etc
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Need to add www user manually
RUN adduser -D -H -G www-data www-data
# Copy Clixon from local dir
RUN mkdir /clixon/clixon
RUN mkdir -p /clixon/clixon
WORKDIR /clixon/clixon
COPY clixon .
# Configure, build and install clixon
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --with-restconf=native --enable-nghttp2 --enable-http1 --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build --with-restconf=native --enable-nghttp2 --enable-http1 --with-yang-standard-dir=/usr/local/share/yang/standard --enable-netsnmp --with-mib-generated-yang-dir=/usr/local/share/mib-yangs/
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Install utils (for tests)
WORKDIR /clixon/clixon/util
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
# Build and install the clixon example
WORKDIR /clixon/clixon/example/main
RUN make
RUN make install
RUN make DESTDIR=/clixon/build install
RUN mkdir -p /clixon/build/etc
RUN install example.xml /clixon/build/etc/clixon.xml
# Copy tests
WORKDIR /clixon/clixon/test
RUN install -d /clixon/build/bin/test
RUN install *.sh /clixon/build/bin/test
RUN install *.exp /clixon/build/bin/test
RUN install clixon.png /clixon/build/bin/test
RUN install -d /clixon/build/usr/local/bin/test
RUN install *.sh /clixon/build/usr/local/bin/test
RUN install *.exp /clixon/build/usr/local/bin/test
RUN install clixon.png /clixon/build/usr/local/bin/test
RUN install -d /clixon/build/mibs
RUN install mibs/* /clixon/build/mibs
@ -119,7 +116,7 @@ RUN install mibs/* /clixon/build/mibs
# Copy startscript
WORKDIR /clixon
COPY startsystem_native.sh startsystem.sh
RUN install startsystem.sh /clixon/build/bin/
RUN install startsystem.sh /clixon/build/usr/local/bin/
# Add our generated YANG files
RUN git clone https://github.com/clicon/mib-yangs.git /usr/local/share/mib-yangs
@ -161,7 +158,7 @@ EXPOSE 443/tcp
# Create clicon user and group
RUN adduser -D -H clicon
COPY --from=0 /clixon/build/ /usr/local/
COPY --from=0 /clixon/build/ /
COPY --from=0 /usr/local/share/yang/ /usr/local/share/yang/
COPY --from=0 /usr/local/share/openconfig/* /usr/local/share/openconfig/
COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/