FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.36k stars 1.25k forks source link

Docker build fails due to missing libyang dep #3512

Closed qlyoung closed 5 years ago

qlyoung commented 5 years ago

Things you may try first

(put "x" in "[ ]" if you already tried following)

Description

Building Docker container with steps documented here fails.

Steps to Reproduce

  1. root@raspberrypi:/home/pi/frr# docker build --rm -f docker/alpine/Dockerfile -t frr:latest .

Expected behavior: Docker image builds successfully

Actual behavior:

Sending build context to Docker daemon  102.5MB
Step 1/19 : FROM alpine:3.7 as source-builder
 ---> a175bcd07e83
Step 2/19 : ARG commit
 ---> Using cache
 ---> 4d966b0ea48f
Step 3/19 : RUN apk add --no-cache abuild acct alpine-sdk attr autoconf automake bash     binutils binutils-libs bison bsd-compat-headers build-base     c-ares c-ares-dev ca-certificates cryptsetup-libs curl  de
vice-mapper-libs expat fakeroot flex fortify-headers g++ gcc gdbm     git gmp isl json-c json-c-dev kmod lddtree libacl libatomic libattr     libblkid libburn libbz2 libc-dev libcap libcurl libedit libffi libgcc
     libgomp libisoburn libisofs libltdl libressl libssh2     libstdc++ libtool libuuid linux-headers lzip lzo m4 make mkinitfs mpc1     mpfr3 mtools musl-dev ncurses-libs ncurses-terminfo ncurses-terminfo-base
    patch pax-utils pcre perl pkgconf python2 python2-dev readline     readline-dev sqlite-libs squashfs-tools sudo tar texinfo xorriso xz-libs     groff gzip bc py-sphinx
 ---> Using cache
 ---> 71e3f44fb56b
Step 4/19 : ADD . /src
 ---> 7b7e2f1b1680
Step 5/19 : RUN (cd /src &&     ./bootstrap.sh &&       ./configure             --enable-numeric-version--with-pkg-extra-version=_git$commit &&         make dist)
 ---> Running in dce5bf85ea59
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
...
checking for netinet6/nd6.h... no
checking for sphinx-build... sphinx-build
checking for crypt in -lcrypt... yes
checking for res_init in -lresolv... yes
checking for CARES (libcares)... yes
checking for libyang (libyang >= 0.16.7)... no
configure: error: libyang (>= 0.16.7) was not found on your system.

Components

build

Versions

qlyoung commented 5 years ago

@ajones-rvbd could you take a quick look at this? I'll try to reproduce on a more mainstream stretch system soon since I know Raspbian has some quirks, but I suspect this is generalized to regular stretch as well.

Edit: It fails on Ubuntu as well.

Looks like we'll need to add libyang to Alpine as well, to get this working cleanly.

1computerguy commented 5 years ago

Was a solution ever found for this issue?

robgil commented 5 years ago

Also bumping up on this. I tried the binary docker build from https://hub.docker.com/r/ajones17/frr/, but its 3mo out of date.

srimohans commented 5 years ago

I too get this error when I tried building my docker container via Dockerfile. When I issue ./configure on my CLI, it works fine. However, when I have this command in Dockerfile and when I tried building docker image, I get the above error.

checking for res_init in -lresolv... no checking for CARES (libcares)... yes checking for LIBYANG (libyang >= 0.16.7)... no configure: error: libyang (>= 0.16.7) was not found on your system.

Any known solution to move forward ?

cfra commented 5 years ago

I think the only good solution for this would be to have a libyang package in Alpine Linux. There is a relatively longstanding bug at https://bugs.alpinelinux.org/issues/9133 for this.

I have just opened https://github.com/alpinelinux/aports/pull/6840 to address this, let's see if we can make any progress. :slightly_smiling_face: