Closed strophy closed 1 month ago
I think I tracked the problem down to the Alpine protobuf-dev
package not containing the *.a
files required for the static linking used by grpc-web
during its build process, they're probably trying to encourage dynamic linking. I ran into a lot of trouble trying to match up protobuf and abseil versions building my own dependencies for a while, but then found the easiest way is to build and install the dependencies linked in the third party submodules directory instead. Build is now working again using the following steps:
FROM alpine:${ALPINE_IMAGE_VERSION} as grpc_web
RUN apk add --no-cache \
autoconf \
automake \
build-base \
git \
libtool
ARG GRPC_WEB_VERSION
RUN git clone --recurse-submodules --branch=$GRPC_WEB_VERSION https://github.com/grpc/grpc-web.git
WORKDIR /grpc-web/third_party/protobuf
RUN ./autogen.sh && \
./configure && \
make -j$(nproc) && \
make install
WORKDIR /grpc-web
RUN make -j$(nproc) install-plugin
RUN install -Ds /usr/local/bin/protoc-gen-grpc-web /out/usr/bin/protoc-gen-grpc-web
I'm trying to build the grpc-web protoc plugin under Alpine as a part of this project using the following Dockerfile:
This results in an enormous error from the Abseil dependency, starting out like this:
Adding
ARG CPPFLAGS=-std=c++17
resolves the Abseil errors but instead returns the following error:I don't think these errors are related to musl libc, is there a problem in the
protobuf-dev
package, or what am I missing here?