Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived Docker Image Build Failed #2384

Closed
opencmit2 opened this issue Feb 18, 2024 · 8 comments
Closed

keepalived Docker Image Build Failed #2384

opencmit2 opened this issue Feb 18, 2024 · 8 comments

Comments

@opencmit2
Copy link

Describe the bug

keepalived Docker Image Build Failed

Log entries

make  dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory `/root/keepalived'
  EDIT     README
if test -d "keepalived-2.2.8"; then find "keepalived-2.2.8" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "keepalived-2.2.8" || { sleep 5 && rm -rf "keepalived-2.2.8"; }; else :; fi
test -d "keepalived-2.2.8" || mkdir "keepalived-2.2.8"
 (cd lib && make  top_distdir=../keepalived-2.2.8 distdir=../keepalived-2.2.8/lib \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/root/keepalived/lib'
make[2]: Leaving directory `/root/keepalived/lib'
 (cd keepalived && make  top_distdir=../keepalived-2.2.8 distdir=../keepalived-2.2.8/keepalived \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/root/keepalived/keepalived'
 (cd core && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/core \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/core'
make[3]: Leaving directory `/root/keepalived/keepalived/core'
 (cd vrrp && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/vrrp \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/vrrp'
make[3]: Leaving directory `/root/keepalived/keepalived/vrrp'
 (cd check && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/check \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/check'
make[3]: Leaving directory `/root/keepalived/keepalived/check'
 (cd dbus && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/dbus \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/dbus'
make[3]: Leaving directory `/root/keepalived/keepalived/dbus'
 (cd bfd && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/bfd \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/bfd'
make[3]: Leaving directory `/root/keepalived/keepalived/bfd'
 (cd trackers && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/trackers \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/trackers'
make[3]: Leaving directory `/root/keepalived/keepalived/trackers'
 (cd etc && make  top_distdir=../../keepalived-2.2.8 distdir=../../keepalived-2.2.8/keepalived/etc \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/keepalived/etc'
 (cd init && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/keepalived/etc/init \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/root/keepalived/keepalived/etc/init'
make[4]: Leaving directory `/root/keepalived/keepalived/etc/init'
 (cd init.d && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/keepalived/etc/init.d \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/root/keepalived/keepalived/etc/init.d'
make[4]: Leaving directory `/root/keepalived/keepalived/etc/init.d'
 (cd keepalived && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/keepalived/etc/keepalived \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/root/keepalived/keepalived/etc/keepalived'
make[4]: Leaving directory `/root/keepalived/keepalived/etc/keepalived'
 (cd sysconfig && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/keepalived/etc/sysconfig \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/root/keepalived/keepalived/etc/sysconfig'
make[4]: Leaving directory `/root/keepalived/keepalived/etc/sysconfig'
make[3]: Leaving directory `/root/keepalived/keepalived/etc'
make[2]: Leaving directory `/root/keepalived/keepalived'
 (cd doc && make  top_distdir=../keepalived-2.2.8 distdir=../keepalived-2.2.8/doc \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/root/keepalived/doc'
 (cd man/man8 && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/doc/man/man8 \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/doc/man/man8'
  EDIT     keepalived.8
make[3]: Leaving directory `/root/keepalived/doc/man/man8'
 (cd man/man5 && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/doc/man/man5 \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/doc/man/man5'
  EDIT     keepalived.conf.5
make[3]: Leaving directory `/root/keepalived/doc/man/man5'
 (cd man/man1 && make  top_distdir=../../../keepalived-2.2.8 distdir=../../../keepalived-2.2.8/doc/man/man1 \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/root/keepalived/doc/man/man1'
  EDIT     genhash.1
make[3]: Leaving directory `/root/keepalived/doc/man/man1'
make  \
  top_distdir="../keepalived-2.2.8" distdir="../keepalived-2.2.8/doc" \
  dist-hook
make[3]: Entering directory `/root/keepalived/doc'
rm -rf `find ../keepalived-2.2.8/doc/doc -type d -name ".git*"`
find: ‘../keepalived-2.2.8/doc/doc’: No such file or directory
make[3]: Leaving directory `/root/keepalived/doc'
make[2]: Leaving directory `/root/keepalived/doc'
 (cd bin_install && make  top_distdir=../keepalived-2.2.8 distdir=../keepalived-2.2.8/bin_install \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/root/keepalived/bin_install'
make[2]: Leaving directory `/root/keepalived/bin_install'
make  \
  top_distdir="keepalived-2.2.8" distdir="keepalived-2.2.8" \
  dist-hook
make[2]: Entering directory `/root/keepalived'
  DATESET git tree
make[2]: Leaving directory `/root/keepalived'
test -n "" \
|| find "keepalived-2.2.8" -type d ! -perm -755 \
        -exec chmod u+rwx,go+rx {} \; -o \
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh /root/keepalived/build-aux/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "keepalived-2.2.8"
tardir=keepalived-2.2.8 && ${TAR-tar} chof - "$tardir" | GZIP=--best gzip -c >keepalived-2.2.8.tar.gz
make[1]: Leaving directory `/root/keepalived'
if test -d "keepalived-2.2.8"; then find "keepalived-2.2.8" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "keepalived-2.2.8" || { sleep 5 && rm -rf "keepalived-2.2.8"; }; else :; fi
docker build -t keepalived --build-arg GIT_VER=`grep GIT_COMMIT lib/git-commit.h | sed -e 's/.*"v[^-]*\(.*\)"/\1/'` .
[+] Building 110.2s (8/9)                                                       
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 2.32kB                                     0.0s
 => [internal] load metadata for docker.io/library/alpine:latest          15.3s
 => CACHED [1/5] FROM docker.io/library/alpine:latest@sha256:21a3deaa0d32  0.0s
 => [internal] load build context                                          0.1s
 => => transferring context: 1.18MB                                        0.0s
 => [2/5] ADD keepalived-2.2.8.tar.gz /tmp                                 0.2s
 => [3/5] RUN addgroup -S keepalived_script && adduser -D -S -G keepalive  0.4s
 => ERROR [4/5] RUN apk --no-cache add  binutils  gcc  libnl3  libnl3-de  94.2s
------                                                                          
 > [4/5] RUN apk --no-cache add         binutils        gcc     libnl3  libnl3-dev      make    musl-dev        openssl         openssl-dev     autoconf       automake     && cd /tmp/keepalived-2.2.8/     && ./autogen.sh     && ./configure--disable-dynamic-linking                --prefix=/usr           --exec-prefix=/usr              --bindir=/usr/bin               --sbindir=/usr/sbin            --sysconfdir=/etc                --datadir=/usr/share            --localstatedir=/var            --mandir=/usr/share/man                 --enable-bfd           --disable-iptables     && make && make install     && strip /usr/sbin/keepalived     && cd -     && rm -rf /tmp/keepalived-2.2.8     && apk --no-cache del      binutils         gcc     libnl3-dev      make    musl-dev        openssl-dev    autoconf         automake:
#0 0.506 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
#0 1.823 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
#0 3.854 (1/27) Upgrading musl (1.2.2-r7 -> 1.2.2-r9)
#0 4.278 (2/27) Upgrading libcrypto1.1 (1.1.1l-r7 -> 1.1.1w-r1)
#0 5.574 (3/27) Upgrading libssl1.1 (1.1.1l-r7 -> 1.1.1w-r1)
#0 5.888 (4/27) Installing m4 (1.4.18-r2)
#0 6.150 (5/27) Installing libbz2 (1.0.8-r1)
#0 6.251 (6/27) Installing perl (5.34.2-r0)
#0 18.38 (7/27) Installing autoconf (2.71-r0)
#0 19.35 (8/27) Installing automake (1.16.4-r1)
#0 20.21 (9/27) Installing libgcc (10.3.1_git20211027-r0)
#0 20.36 (10/27) Installing libstdc++ (10.3.1_git20211027-r0)
#0 21.29 (11/27) Installing binutils (2.37-r3)
#0 24.70 (12/27) Installing libgomp (10.3.1_git20211027-r0)
#0 24.89 (13/27) Installing libatomic (10.3.1_git20211027-r0)
#0 24.96 (14/27) Installing libgphobos (10.3.1_git20211027-r0)
#0 27.08 (15/27) Installing gmp (6.2.1-r1)
#0 27.34 (16/27) Installing isl22 (0.22-r0)
#0 28.00 (17/27) Installing mpfr4 (4.1.0-r0)
#0 30.10 (18/27) Installing mpc1 (1.2.1-r0)
#0 30.20 (19/27) Installing gcc (10.3.1_git20211027-r0)
#0 67.78 (20/27) Installing libnl3 (3.5.0-r0)
#0 69.22 (21/27) Installing libnl3-cli (3.5.0-r0)
#0 69.79 (22/27) Installing pkgconf (1.8.1-r0)
#0 69.93 (23/27) Installing libnl3-dev (3.5.0-r0)
#0 70.37 (24/27) Installing make (4.3-r0)
#0 70.58 (25/27) Installing musl-dev (1.2.2-r9)
#0 73.99 (26/27) Installing openssl (1.1.1w-r1)
#0 74.29 (27/27) Installing openssl-dev (1.1.1w-r1)
#0 74.64 Executing busybox-1.34.1-r3.trigger
#0 74.65 OK: 173 MiB in 38 packages
#0 76.45 aclocal: overwriting 'm4/pkg.m4' with '/usr/share/aclocal/pkg.m4'
#0 79.50 configure.ac:377: installing 'build-aux/compile'
#0 86.04 checking for a BSD-compatible install... /usr/bin/install -c
#0 86.35 checking whether build environment is sane... yes
#0 86.36 checking for a race-free mkdir -p... ./build-aux/install-sh -c -d
#0 86.37 checking for gawk... no
#0 86.37 checking for mawk... no
#0 86.37 checking for nawk... no
#0 86.37 checking for awk... awk
#0 86.37 checking whether make sets $(MAKE)... yes
#0 86.38 checking whether make supports nested variables... yes
#0 86.39 checking whether make supports nested variables... (cached) yes
#0 86.39 checking for pkg-config... /usr/bin/pkg-config
#0 86.39 checking pkg-config is at least version 0.9.0... yes
#0 86.40 checking for gcc... gcc
#0 86.44 checking whether the C compiler works... yes
#0 86.50 checking for C compiler default output file name... a.out
#0 86.51 checking for suffix of executables... 
#0 86.57 checking whether we are cross compiling... no
#0 86.64 checking for suffix of object files... o
#0 86.69 checking whether the compiler supports GNU C... yes
#0 86.74 checking whether gcc accepts -g... yes
#0 86.79 checking for gcc option to enable C11 features... none needed
#0 86.91 checking whether gcc understands -c and -o together... yes
#0 86.99 checking whether make supports the include directive... yes (GNU style)
#0 87.01 checking dependency style of gcc... gcc3
#0 87.06 checking whether make sets $(MAKE)... (cached) yes
#0 87.06 checking for ranlib... ranlib
#0 87.07 checking for grep that handles long lines and -e... /bin/grep
#0 87.15 checking whether ln -s works... yes
#0 87.15 checking for a sed that does not truncate output... /bin/sed
#0 87.16 checking for strip... strip
#0 87.16 checking for ldd... ldd
#0 87.16 checking for ar... ar
#0 87.16 checking the archiver (ar) interface... ar
#0 87.21 checking if using GCC Link Time Optimisation... no
#0 87.22 checking msghdr.msg_controllen is size_t... no
#0 87.27 checking diagnostic pragmas in functions... yes
#0 87.32 checking diagnostic push/pop pragmas... yes
#0 87.37 checking for -Wall... yes
#0 87.43 checking for -Wextra... yes
#0 87.49 checking for -Wunused... yes
#0 87.55 checking for -Wstrict-prototypes... yes
#0 87.61 checking for -Wabi... yes
#0 87.67 checking for -Wabsolute-value... yes
#0 87.73 checking for -Waddress-of-packed-member... yes
#0 87.79 checking for -Walloca... yes
#0 87.85 checking for -Walloc-larger-than=4096... no
#0 87.90 checking for -Walloc-zero... yes
#0 87.98 checking for -Warith-conversion... yes
#0 88.04 checking for -Warray-bounds=2... yes
#0 88.11 checking for -Wattribute-alias=2... yes
#0 88.17 checking for -Wbad-function-cast... yes
#0 88.23 checking for -Wc11-c2x-compat... yes
#0 88.29 checking for -Wcast-align... yes
#0 88.36 checking for -Wcast-qual... yes
#0 88.42 checking for -Wchkp... no
#0 88.48 checking for -Wdate-time... yes
#0 88.54 checking for -Wdisabled-optimization... yes
#0 88.60 checking for -Wdouble-promotion... yes
#0 88.66 checking for -Wduplicated-branches... yes
#0 88.72 checking for -Wduplicated-cond... yes
#0 88.78 checking for -Wfloat-conversion... yes
#0 88.84 checking for -Wfloat-equal... yes
#0 88.90 checking for -Wformat-overflow... yes
#0 88.96 checking for -Wformat-security... yes
#0 89.01 checking for -Wformat-signedness... yes
#0 89.08 checking for -Wformat-truncation... yes
#0 89.14 checking for -Wframe-larger-than=5120... yes
#0 89.21 checking for -Wimplicit-fallthrough=3... yes
#0 89.28 checking for -Winit-self... yes
#0 89.34 checking for -Winline... yes
#0 89.40 checking for -Winvalid-pch... yes
#0 89.46 checking for -Wjump-misses-init... yes
#0 89.52 checking for -Wlogical-op... yes
#0 89.58 checking for -Wmissing-declarations... yes
#0 89.64 checking for -Wmissing-field-initializers... yes
#0 89.70 checking for -Wmissing-include-dirs... yes
#0 89.76 checking for -Wmissing-prototypes... yes
#0 89.82 checking for -Wnested-externs... yes
#0 89.88 checking for -Wnormalized... yes
#0 89.94 checking for -Wnull-dereference... yes
#0 90.00 checking for -Wold-style-definition... yes
#0 90.07 checking for -Woverlength-strings... yes
#0 90.13 checking for -Wpointer-arith... yes
#0 90.19 checking for -Wredundant-decls... yes
#0 90.25 checking for -Wshadow... yes
#0 90.31 checking for -Wshift-overflow=2... yes
#0 90.37 checking for -Wstack-protector... yes
#0 90.43 checking for -Wstrict-overflow=4... yes
#0 90.50 checking for -Wstringop-overflow=2... yes
#0 90.57 checking for -Wstringop-truncation... yes
#0 90.63 checking for -Wsuggest-attribute=cold... yes
#0 90.69 checking for -Wsuggest-attribute=const... no
#0 90.75 checking for -Wsuggest-attribute=format... yes
#0 90.81 checking for -Wsuggest-attribute=malloc... yes
#0 90.88 checking for -Wsuggest-attribute=noreturn... yes
#0 90.94 checking for -Wsuggest-attribute=pure... yes
#0 91.00 checking for -Wsync-nand... yes
#0 91.06 checking for -Wtrampolines... yes
#0 91.12 checking for -Wundef... yes
#0 91.18 checking for -Wuninitialized... yes
#0 91.24 checking for -Wunknown-pragmas... yes
#0 91.30 checking for -Wunsafe-loop-optimizations... yes
#0 91.36 checking for -Wunsuffixed-float-constants... yes
#0 91.42 checking for -Wunused-const-variable=2... yes
#0 91.49 checking for -Wunused-macros... no
#0 91.55 checking for -Wvariadic-macros... yes
#0 91.61 checking for -Wwrite-strings... yes
#0 91.72 checking for function __attribute__((error(msg))) support... no
#0 91.77 checking for function __attribute__((warn_unused_result)) support... yes
#0 91.85 checking for PIE support... yes
#0 91.93 checking for -Wformat -Werror=format-security support... yes
#0 91.96 checking for -Wp,-D_FORTIFY_SOURCE=2 support... yes
#0 92.00 checking for -fexceptions support... yes
#0 92.04 checking for -fstack-protector-strong support... yes
#0 92.07 checking for --param=ssp-buffer-size=4 support... yes
#0 92.11 checking for -grecord-gcc-switches support... yes
#0 92.14 checking for -Wl,-z,relro support... yes
#0 92.22 checking for -Wl,-z,now support... yes
#0 92.29 checking for -O2 support... yes
#0 92.33 CFLAGS=-g -g -O2 -Wall -Wextra -Wunused -Wstrict-prototypes -Wabi -Wabsolute-value -Waddress-of-packed-member -Walloca -Walloc-zero -Warith-conversion -Warray-bounds=2 -Wattribute-alias=2 -Wbad-function-cast -Wc11-c2x-compat -Wcast-align -Wcast-qual -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wfloat-conversion -Wfloat-equal -Wformat-overflow -Wformat-security -Wformat-signedness -Wformat-truncation -Wframe-larger-than=5120 -Wimplicit-fallthrough=3 -Winit-self -Winline -Winvalid-pch -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnormalized -Wnull-dereference -Wold-style-definition -Woverlength-strings -Wpointer-arith -Wredundant-decls -Wshadow -Wshift-overflow=2 -Wstack-protector -Wstrict-overflow=4 -Wstringop-overflow=2 -Wstringop-truncation -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=malloc -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsync-nand -Wtrampolines -Wundef -Wuninitialized -Wunknown-pragmas -Wunsafe-loop-optimizations -Wunsuffixed-float-constants -Wunused-const-variable=2 -Wvariadic-macros -Wwrite-strings -fno-strict-aliasing -fPIE -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -O2
#0 92.44 checking for unaligned memory access... yes
#0 92.52 checking for unaligned memory access causes warnings... no
#0 92.57 checking for clock_gettime() requires -lrt... no
#0 92.65 checking for stdio.h... yes
#0 92.69 checking for stdlib.h... yes
#0 92.73 checking for string.h... yes
#0 92.78 checking for inttypes.h... yes
#0 92.84 checking for stdint.h... yes
#0 92.89 checking for strings.h... yes
#0 92.94 checking for sys/stat.h... yes
#0 92.99 checking for sys/types.h... yes
#0 93.04 checking for unistd.h... yes
#0 93.09 checking for vfork.h... no
#0 93.14 checking for arpa/inet.h... yes
#0 93.20 checking for fcntl.h... yes
#0 93.26 checking for limits.h... yes
#0 93.32 checking for netdb.h... yes
#0 93.38 checking for netinet/in.h... yes
#0 93.45 checking for stdint.h... (cached) yes
#0 93.45 checking for stdlib.h... (cached) yes
#0 93.46 checking for string.h... (cached) yes
#0 93.47 checking for sys/ioctl.h... yes
#0 93.52 checking for sys/param.h... yes
#0 93.59 checking for sys/prctl.h... yes
#0 93.65 checking for sys/socket.h... yes
#0 93.70 checking for sys/time.h... yes
#0 93.76 checking for syslog.h... yes
#0 93.82 checking for unistd.h... (cached) yes
#0 93.83 checking linux/errqueue.h needs sys/time.h... yes
#0 93.87 checking for asm/types.h... no
#0 93.91 configure: error: Missing/unusable kernel header file <asm/types.h>
------
Dockerfile:19
--------------------
  18 |     # 3. remove keepalived sources and unnecessary libraries and tools
  19 | >>> RUN apk --no-cache add \
  20 | >>>      binutils \
  21 | >>> #    file \
  22 | >>> #    file-dev \
  23 | >>>      gcc \
  24 | >>> #    glib \
  25 | >>> #    glib-dev \
  26 | >>> #    ipset \
  27 | >>> #    ipset-dev \
  28 | >>> #    iptables \
  29 | >>> #    iptables-dev \
  30 | >>> #    libmnl-dev \
  31 | >>> #    libnftnl-dev \
  32 | >>>      libnl3 \
  33 | >>>      libnl3-dev \
  34 | >>>      make \
  35 | >>>      musl-dev \
  36 | >>> #    net-snmp-dev \
  37 | >>>      openssl \
  38 | >>>      openssl-dev \
  39 | >>> #    pcre2 \
  40 | >>> #    pcre2-dev \
  41 | >>>      autoconf \
  42 | >>>      automake \
  43 | >>>     && cd /tmp/keepalived-2.2.8/ \
  44 | >>>     && ./autogen.sh \
  45 | >>>     && ./configure \
  46 | >>>              --disable-dynamic-linking \
  47 | >>>              --prefix=/usr \
  48 | >>>              --exec-prefix=/usr \
  49 | >>>              --bindir=/usr/bin \
  50 | >>>              --sbindir=/usr/sbin \
  51 | >>>              --sysconfdir=/etc \
  52 | >>>              --datadir=/usr/share \
  53 | >>>              --localstatedir=/var \
  54 | >>>              --mandir=/usr/share/man \
  55 | >>> #            --with-dbus-data-dir=/usr/share \
  56 | >>>              --enable-bfd \
  57 | >>> #            --enable-dbus \
  58 | >>> #            --enable-regex \
  59 | >>> #            --enable-snmp \
  60 | >>> #            --enable-snmp-rfc \
  61 | >>> #            --enable-nftables \
  62 | >>>              --disable-iptables \
  63 | >>> #            --disable-libipset \
  64 | >>> #            --enable-json \
  65 | >>>     && make && make install \
  66 | >>>     && strip /usr/sbin/keepalived \
  67 | >>>     && cd - \
  68 | >>>     && rm -rf /tmp/keepalived-2.2.8 \
  69 | >>>     && apk --no-cache del \
  70 | >>>      binutils \
  71 | >>> #    file-dev \
  72 | >>>      gcc \
  73 | >>> #    glib-dev \
  74 | >>> #    ipset-dev \
  75 | >>> #    iptables-dev \
  76 | >>> #    libmnl-dev \
  77 | >>>      libnl3-dev \
  78 | >>> #    libnftnl-dev \
  79 | >>>      make \
  80 | >>>      musl-dev \
  81 | >>>      openssl-dev \
  82 | >>> #    pcre2-dev \
  83 | >>>      autoconf \
  84 | >>>      automake
  85 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apk --no-cache add \tbinutils \tgcc \tlibnl3 \tlibnl3-dev \tmake \tmusl-dev \topenssl \topenssl-dev \tautoconf \tautomake     && cd /tmp/keepalived-2.2.8/     && ./autogen.sh     && ./configure \t\t--disable-dynamic-linking \t\t--prefix=/usr \t\t--exec-prefix=/usr \t\t--bindir=/usr/bin \t\t--sbindir=/usr/sbin \t\t--sysconfdir=/etc \t\t--datadir=/usr/share \t\t--localstatedir=/var \t\t--mandir=/usr/share/man \t\t--enable-bfd \t\t--disable-iptables     && make && make install     && strip /usr/sbin/keepalived     && cd -     && rm -rf /tmp/keepalived-2.2.8     && apk --no-cache del \tbinutils \tgcc \tlibnl3-dev \tmake \tmusl-dev \topenssl-dev \tautoconf \tautomake" did not complete successfully: exit code: 1
make: *** [docker] Error 1
@pqarmitage
Copy link
Collaborator

As it says above, your system appears to be missing <asm/types.h>

configure: error: Missing/unusable kernel header file <asm/types.h>

However, checking the code, the check for that file appears to be superfluous, since the presence of the file defines HAVE_ASM_TYPE_H, but the keepalived code never tests for that definition.

Can you please edit your configure.ac at around line 1168 to change
AC_CHECK_HEADERS([asm/types.h linux/ethtool.h linux/icmpv6.h linux/if_ether.h linux/if_packet.h linux/ip.h linux/sockios.h linux/types.h],
to
AC_CHECK_HEADERS([linux/ethtool.h linux/icmpv6.h linux/if_ether.h linux/if_packet.h linux/ip.h linux/sockios.h linux/types.h],
(i.e. remove asm/types.h) and try building with that change.

If this fixes your problem, I will push a patch to remove the check for asm/types.h.

@opencmit2
Copy link
Author

Hi @pqarmitage
I have made changes to configure.ac according to the method you provided, but the problem still remains unsolved.

The error log is as follows:

#0 28.82 checking for syslog.h... yes
#0 28.88 checking for unistd.h... (cached) yes
#0 28.89 checking linux/errqueue.h needs sys/time.h... yes
#0 28.92 checking for linux/ethtool.h... no
#0 28.97 configure: error: Missing/unusable kernel header file <linux/ethtool.h>
------
Dockerfile:19
--------------------
  18 |     # 3. remove keepalived sources and unnecessary libraries and tools
  19 | >>> RUN apk --no-cache add \
  20 | >>>      binutils \
  21 | >>> #    file \
  22 | >>> #    file-dev \
  23 | >>>      gcc \
  24 | >>> #    glib \
  25 | >>> #    glib-dev \
  26 | >>> #    ipset \
  27 | >>> #    ipset-dev \
  28 | >>> #    iptables \
  29 | >>> #    iptables-dev \
  30 | >>> #    libmnl-dev \
  31 | >>> #    libnftnl-dev \
  32 | >>>      libnl3 \
  33 | >>>      libnl3-dev \
  34 | >>>      make \
  35 | >>>      musl-dev \
  36 | >>> #    net-snmp-dev \
  37 | >>>      openssl \
  38 | >>>      openssl-dev \
  39 | >>> #    pcre2 \
  40 | >>> #    pcre2-dev \
  41 | >>>      autoconf \
  42 | >>>      automake \
  43 | >>>     && cd /tmp/keepalived-2.2.8/ \
  44 | >>>     && ./autogen.sh \
  45 | >>>     && ./configure \
  46 | >>>              --disable-dynamic-linking \
  47 | >>>              --prefix=/usr \
  48 | >>>              --exec-prefix=/usr \
  49 | >>>              --bindir=/usr/bin \
  50 | >>>              --sbindir=/usr/sbin \
  51 | >>>              --sysconfdir=/etc \
  52 | >>>              --datadir=/usr/share \
  53 | >>>              --localstatedir=/var \
  54 | >>>              --mandir=/usr/share/man \
  55 | >>> #            --with-dbus-data-dir=/usr/share \
  56 | >>>              --enable-bfd \
  57 | >>> #            --enable-dbus \
  58 | >>> #            --enable-regex \
  59 | >>> #            --enable-snmp \
  60 | >>> #            --enable-snmp-rfc \
  61 | >>> #            --enable-nftables \
  62 | >>>              --disable-iptables \
  63 | >>> #            --disable-libipset \
  64 | >>> #            --enable-json \
  65 | >>>     && make && make install \
  66 | >>>     && strip /usr/sbin/keepalived \
  67 | >>>     && cd - \
  68 | >>>     && rm -rf /tmp/keepalived-2.2.8 \
  69 | >>>     && apk --no-cache del \
  70 | >>>      binutils \
  71 | >>> #    file-dev \
  72 | >>>      gcc \
  73 | >>> #    glib-dev \
  74 | >>> #    ipset-dev \
  75 | >>> #    iptables-dev \
  76 | >>> #    libmnl-dev \
  77 | >>>      libnl3-dev \
  78 | >>> #    libnftnl-dev \
  79 | >>>      make \
  80 | >>>      musl-dev \
  81 | >>>      openssl-dev \
  82 | >>> #    pcre2-dev \
  83 | >>>      autoconf \
  84 | >>>      automake
  85 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apk --no-cache add \tbinutils \tgcc \tlibnl3 \tlibnl3-dev \tmake \tmusl-dev \topenssl \topenssl-dev \tautoconf \tautomake     && cd /tmp/keepalived-2.2.8/     && ./autogen.sh     && ./configure \t\t--disable-dynamic-linking \t\t--prefix=/usr \t\t--exec-prefix=/usr \t\t--bindir=/usr/bin \t\t--sbindir=/usr/sbin \t\t--sysconfdir=/etc \t\t--datadir=/usr/share \t\t--localstatedir=/var \t\t--mandir=/usr/share/man \t\t--enable-bfd \t\t--disable-iptables     && make && make install     && strip /usr/sbin/keepalived     && cd -     && rm -rf /tmp/keepalived-2.2.8     && apk --no-cache del \tbinutils \tgcc \tlibnl3-dev \tmake \tmusl-dev \topenssl-dev \tautoconf \tautomake" did not complete successfully: exit code: 1
make: *** [docker] Error 1

@pqarmitage
Copy link
Collaborator

You appear not to have the kernel-headers package (or whatever your distro calls the package) installed. Although the check checking linux/errqueue.h needs sys/time.h... yes appears to imply that linux/errqueue.h is installed, the way the check is done the result of the test will be yes if linux/errqueue.h is NOT installed. Your tests so far have shown that asm/types.h and linux/ethtool.h are not installed, hence the kernel headers package is not installed, at least not in the place that the build expects to find the headers.

@pqarmitage
Copy link
Collaborator

Following looking at this issue I realised that some kernel header files where checked (in configure) and included at compile time when they weren't needed (i.e. if building without VRRP or IPVS functionality). Commit 6eb9303 tidies that up.

@im-jinxinwang
Copy link

Hi @pqarmitage
I'm using the Dockerfile to build the image, and I think the problem may be with the base image or the lack of some necessary packages that prevent the successful building of the image. The modifications you made still can't successfully execute "make docker".

@pqarmitage
Copy link
Collaborator

I wouldn't expect the modifications I made to resolve your problem, it was just some tidying up that I noticed could be done.

I notice in the logs you provide that there are 27 packages upgraded/installed. I don't know where it is specified what packages should be installed, but you need to add the kernel-headers package into the list of installed packages.

@im-jinxinwang
Copy link

@pqarmitage
Here is the generated Dockerfile from Dockerfile.in, which uses alpine as the base image. Do you have any solutions? I've tried downloading kernel-headers using apt, but it didn't solve the issue.

FROM alpine:latest
ARG GIT_VER=
ENV VER=2.2.8
LABEL version=2.2.8${GIT_VER}
LABEL author="Alexandre Cassen <acassen@gmail.com>"
LABEL project="https://github.com/acassen/keepalived"
LABEL homepage="https://www.keepalived.org"

# add keepalived sources to /tmp/keepalived-2.2.8
ADD keepalived-2.2.8.tar.gz /tmp

# Add keepalived default script user to make sure their IDs get assigned consistently,
# regardless of whatever dependencies get added
RUN addgroup -S keepalived_script && adduser -D -S -G keepalived_script keepalived_script

# 1. install required libraries and tools
# 2. compile and install keepalived
# 3. remove keepalived sources and unnecessary libraries and tools
RUN apk --no-cache add \
        binutils \
#       file \
#       file-dev \
        gcc \
#       glib \
#       glib-dev \
#       ipset \
#       ipset-dev \
#       iptables \
#       iptables-dev \
#       libmnl-dev \
#       libnftnl-dev \
        libnl3 \
        libnl3-dev \
        make \
        musl-dev \
#       net-snmp-dev \
        openssl \
        openssl-dev \
#       pcre2 \
#       pcre2-dev \
        autoconf \
        automake \
        linux-headers \
    && cd /tmp/keepalived-2.2.8/ \
    && ./autogen.sh \
    && ./configure \
                --disable-dynamic-linking \
                --prefix=/usr \
                --exec-prefix=/usr \
                --bindir=/usr/bin \
                --sbindir=/usr/sbin \
                --sysconfdir=/etc \
                --datadir=/usr/share \
                --localstatedir=/var \
                --mandir=/usr/share/man \
#               --with-dbus-data-dir=/usr/share \
                --enable-bfd \
#               --enable-dbus \
#               --enable-regex \
#               --enable-snmp \
#               --enable-snmp-rfc \
#               --enable-nftables \
                --disable-iptables \
#               --disable-libipset \
#               --enable-json \
    && make && make install \
    && strip /usr/sbin/keepalived \
    && cd - \
    && rm -rf /tmp/keepalived-2.2.8 \
    && apk --no-cache del \
        binutils \
#       file-dev \
        gcc \
#       glib-dev \
#       ipset-dev \
#       iptables-dev \
#       libmnl-dev \
        libnl3-dev \
#       libnftnl-dev \
        make \
        musl-dev \
        openssl-dev \
#       pcre2-dev \
        autoconf \
        automake

ADD docker/keepalived.conf /etc/keepalived/keepalived.conf

# set keepalived as image entrypoint with --dont-fork and --log-console (to make it docker friendly)
# define /etc/keepalived/keepalived.conf as the configuration file to use
ENTRYPOINT ["/usr/sbin/keepalived","--dont-fork","--log-console", "-f","/etc/keepalived/keepalived.conf"]

# example command to customise keepalived daemon:
# CMD ["--log-detail","--dump-conf"]

@pqarmitage
Copy link
Collaborator

Unfortunately I have no experience of using Docker, and next to no experience of Alpine.

A google search for "alpine linux kernel headers package" suggests that the kernel headers package is called linux-headers. It would seem likely that in the apk --no-cache add \ list of packages, and also in the apk --no-cache del list of packages, you need to add linux-headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants