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/