confluentinc / bottledwater-pg

Change data capture from PostgreSQL into Kafka
http://blog.confluent.io/2015/04/23/bottled-water-real-time-integration-of-postgresql-and-kafka/
Apache License 2.0
2 stars 149 forks source link

make docker-compose fails with "cannot find -lz" #131

Open brunograsselli opened 7 years ago

brunograsselli commented 7 years ago

Hi, I am trying to run bottled water with docker.

When I execute make docker-compose I get the following error:

make -C kafka all
make[1]: Entering directory '/root/bottledwater/kafka'
gcc bottledwater.c -c -std=c99 -D_POSIX_C_SOURCE=200809L -I../client -I../ext -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server  -I/usr/local/include  -DAVRO_1_8   -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -o bottledwater.o
gcc json.c -c -std=c99 -D_POSIX_C_SOURCE=200809L -I../client -I../ext -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server  -I/usr/local/include  -DAVRO_1_8   -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -o json.o
gcc registry.c -c -std=c99 -D_POSIX_C_SOURCE=200809L -I../client -I../ext -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server  -I/usr/local/include  -DAVRO_1_8   -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -o registry.o
gcc table_mapper.c -c -std=c99 -D_POSIX_C_SOURCE=200809L -I../client -I../ext -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server  -I/usr/local/include  -DAVRO_1_8   -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -o table_mapper.o
gcc logger.c -c -std=c99 -D_POSIX_C_SOURCE=200809L -I../client -I../ext -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server  -I/usr/local/include  -DAVRO_1_8   -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -o logger.o
gcc bottledwater.o json.o registry.o table_mapper.o logger.o ../client/libbottledwater.a -o bottledwater -L/usr/lib/x86_64-linux-gnu -lpq -lrdkafka -lz -lpthread  -L/usr/local/lib -lavro  -L/usr/lib/x86_64-linux-gnu -lcurl -ljansson
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:29: recipe for target 'bottledwater' failed
make[1]: *** [bottledwater] Error 1
make[1]: Leaving directory '/root/bottledwater/kafka'
make: *** [all] Error 2
Makefile:6: recipe for target 'all' failed
The command '/bin/sh -c cd /root/bottledwater &&     make clean && make && make install && cd / &&     tar czf bottledwater-ext.tar.gz usr/lib/postgresql/${PG_MAJOR}/lib/bottledwater.so usr/share/postgresql/${PG_MAJOR}/extension/bottledwater* &&     cp /root/bottledwater/kafka/bottledwater /root/bottledwater/client/bwtest /usr/local/bin &&     tar czf bottledwater-bin.tar.gz usr/local/bin/bottledwater usr/local/bin/bwtest' returned a non-zero code: 2
make: *** [docker-build] Error 2

Some information about my environment:

$ docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      linux/amd64
 Experimental: true
$ docker-compose version
docker-compose version 1.11.1, build 7c5d5e4
docker-py version: 2.0.2
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
$ git log -1
commit e9a53794435f0e6941d7d3646a09942341c0cd9d
Merge: 7d1f9d3 cc5190e
Author: Sam Stokes <me@samstokes.co.uk>
Date:   Wed Sep 7 14:43:32 2016 -0700

    Merge pull request #114 from buzila/master

    Represent NUMERIC as "double" rather than zero #4

Is it a known issue? Anything I might be doing wrong?

Thanks!

dudleycarr commented 7 years ago

I ran into the same issue. Worked around the issue by adding zlib1g-dev into the set of package installed by apt-get in build/Dockerfile.build and build/Dockerfile.build94

brunograsselli commented 7 years ago

Thanks @dudleycarr , it works!

wswuai commented 7 years ago

same issue.

same fix like @dudleycarr 👍

/build/Dockerfile.build