Open constantinevassil opened 6 years ago
https://github.com/mapbox/tippecanoe/blob/master/Dockerfile is an example of a Dockerfile that builds Tippecanoe (and then runs its tests).
Eric,
I tried with Ubuntu and also CentOS Docker images.
I do the following in the Dockerimage: 1) Install tippecanoe 2) Golang 3) Golang server 4) in Golang server I have a handler like this: cmd := exec.Command("bash", "/cmd.sh") 5) in cmd.sh - the following command for testing: tippecanoe --version
when executing this command I get an error
If you don't say what the error is, I can't help much. Perhaps your tippecanoe script just does make
instead of make install
, so it is only built in the local directory instead of installed in /usr/local/bin
? Perhaps /usr/local/bin
isn't in your $PATH
?
Would it work with Alpine?
There a lot of warnings:
g++ -MMD -I/usr/local/include -I. -g -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow -O3 -DNDEBUG -std=c++11 -c -o geojson.o geojson.cpp In file included from geojson.hpp:10:0, from geojson.cpp:33: serial.hpp:96:22: warning: missing initializer for member 'stat::st_dev' [-Wmissing-field-initializers] struct stat geomst {}; ^ serial.hpp:96:22: warning: missing initializer for member 'stat::st_ino' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_nlink' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_mode' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_uid' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_gid' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::__pad0' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_rdev' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_size' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_blksize' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_blocks' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_atim' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_mtim' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::st_ctim' [-Wmissing-field-initializers] serial.hpp:96:22: warning: missing initializer for member 'stat::__unused' [-Wmissing-field-initializers] serial.hpp:97:22: warning: missing initializer for member 'stat::st_dev' [-Wmissing-field-initializers]
This particular warning only happens on Linux, where the system headers for struct stat
aren't initialized and aren't tagged in such a way that the compiler knows that they are system headers. Unfortunately as far as I know there isn't a way to avoid these warnings while continuing to warn of legitimate failures to initialize fields within Tippecanoe itself.
Not sure how helpful this is but gcc has pragmas that disable individual warnings. Each warning message indicates the message's corresponding option, and this is what you stick into the pragma:
To save building time I created Tippecanoe binary in a Docker image and then made a copy of the binaries to another Docker image. It saves time for building it every time and space.
I need it to be in Alpine and did it the following way:
FROM alpine:3.8
RUN apk update && apk upgrade
RUN apk add --no-cache --virtual bash RUN apk add --no-cache --virtual g++ RUN apk add --no-cache --virtual make RUN apk add --no-cache --virtual git RUN apk add --no-cache --virtual sqlite-dev RUN apk add --no-cache --virtual zlib-dev
RUN apk add --no-cache --virtual libgcc RUN apk add --no-cache --virtual libstdc++ RUN apk add --no-cache --virtual sqlite-libs
WORKDIR /docker/
RUN git clone --depth=1 https://github.com/mapbox/tippecanoe.git RUN make install -j --directory=tippecanoe
RUN rm -rf /docker/
Then upload to Google Repository: gcr.io/my/tippecanoe
RUN apk add --no-cache --virtual libgcc RUN apk add --no-cache --virtual libstdc++ RUN apk add --no-cache --virtual sqlite-libs
Then run the tile-join inside the second Docker image. It is not working - I suppose I need to install additional runtime dependencies.
I have these:
RUN apk add --no-cache --virtual libgcc RUN apk add --no-cache --virtual libstdc++ RUN apk add --no-cache --virtual sqlite-libs
What more I need?
I would like to build tippecanoe inside my own Dockerfile based on Debian. How to do that?