I have successfully built and run TileServer GL from source in a Debian environment, however the requirements for this installation are that it be on CentOS 7 and it seems as though I've encountered an insurmountable problem. I'm not a linux expert by any stretch of the imagination though, so I'm hoping someone here might be able to offer some guidance.
Below is the portion of my Dockerfile where I'm installing Node and CentOS dependencies:
FROM centos:latest
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
RUN yum -y install nodejs \
cairo \
cairo-devel \
gcc-c++ \
libcurl-devel \
libgcc.x86_64 \
libXxf86vm-devel \
make \
mesa-libGL-devel \
mesa-libgbm \
mesa-libGLES \
protobuf-devel \
xorg-x11-server-Xvfb
RUN rm -rf /var/cache/yum
# Symlink to libcurl-gnutls
RUN ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4
When I docker run
the image, TileServer tries to start but then says:
Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /tileserver-gl/node_modules/@mapbox/mapbox-gl-native/lib/mapbox_gl_native.node)
In CentOS 7, the versions of GLIBCXX stop at 3.4.19 and, from what I've read, there's no way to change this. So my questions are:
1) Is it true that I can't update libstdc++ in CentOS?
2) If true, then is there another way around this? Is there perhaps a way I could build TileServer GL or mapbox-gl-native where earlier versions of c++ are acceptable?
This problem is mentioned in this issue thread but there's never any resolution. Any help with this would be really great.
Add
RUN echo "[warning:fedora]" | tee /etc/yum.repos.d/FedoraRepo.repo && \
echo "name=fedora" | tee -a /etc/yum.repos.d/FedoraRepo.repo && \
echo "mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-23&arch=\$basearch" | tee -a /etc/yum.repos.d/FedoraRepo.repo && \
echo "enabled=1" | tee -a /etc/yum.repos.d/FedoraRepo.repo && \
echo "gpgcheck=1" | tee -a /etc/yum.repos.d/FedoraRepo.repo && \
echo "gpgkey=https://getfedora.org/static/34EC9CBA.txt" | tee -a /etc/yum.repos.d/FedoraRepo.repo && \
yum -y update gcc g++
to your Docker image and it should work. It's a bit hacky, but it works :)