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,9 +42,8 @@ RUN apk add --update git make build-base gcc flex bison curl-dev
RUN apk add --update nghttp2 RUN apk add --update nghttp2
# Create a directory to hold source-code, dependencies etc # Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon RUN mkdir -p /clixon/build
RUN mkdir /clixon/build
WORKDIR /clixon WORKDIR /clixon
# Clone cligen # Clone cligen
@ -52,34 +51,34 @@ RUN git clone https://github.com/clicon/cligen.git
# Build cligen # Build cligen
WORKDIR /clixon/cligen WORKDIR /clixon/cligen
RUN ./configure --prefix=/clixon/build RUN ./configure --prefix=/usr/local
RUN make RUN make
RUN make install RUN make DESTDIR=/clixon/build install
# Need to add www user manually # Need to add www user manually
RUN adduser -D -H -G www-data www-data RUN adduser -D -H -G www-data www-data
# Copy Clixon from local dir # Copy Clixon from local dir
RUN mkdir /clixon/clixon RUN mkdir -p /clixon/clixon
WORKDIR /clixon/clixon WORKDIR /clixon/clixon
COPY clixon . COPY clixon .
# Configure, build and install clixon # Configure, build and install clixon
RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --with-restconf=native --enable-nghttp2 --enable-http1 RUN ./configure --prefix=/usr/local --with-cligen=/clixon/build --with-restconf=native --enable-nghttp2 --enable-http1
RUN make RUN make
RUN make install RUN make DESTDIR=/clixon/build install
RUN make install-include RUN make DESTDIR=/clixon/build install-include
# Install main example # Install main example
WORKDIR /clixon/clixon/example/main WORKDIR /clixon/clixon/example/main
RUN make RUN make
RUN make install RUN make DESTDIR=/clixon/build install
# Copy startscript # Copy startscript
WORKDIR /clixon WORKDIR /clixon
COPY startsystem.sh startsystem.sh COPY startsystem.sh startsystem.sh
RUN install startsystem.sh /clixon/build/bin/ RUN install startsystem.sh /clixon/build/usr/local/bin/
# #
# Stage 2 # Stage 2
@ -109,7 +108,7 @@ RUN echo "Subsystem netconf /usr/local/bin/clixon_netconf" >> /etc/ssh/sshd_conf
# Create clicon user and group # Create clicon user and group
RUN adduser -D -H clicon RUN adduser -D -H clicon
COPY --from=0 /clixon/build/ /usr/local/ COPY --from=0 /clixon/build/ /
# Overwrite config file since install dirs are wrong # Overwrite config file since install dirs are wrong
COPY example.xml /usr/local/etc/example.xml COPY example.xml /usr/local/etc/example.xml

View file

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

View file

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