[SERVER-49140] [FLE] Add mongocryptd for Linux Alpine Created: 26/Jun/20  Updated: 26/Jan/24  Resolved: 10/May/23

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 4.2.8
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Wan Bachtiar Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Fix Votes: 11
Labels: platform-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to MONGOCRYPT-416 Publish libmongocrypt builds for Alpi... Backlog
is related to SERVER-36790 Add build for Linux Alpine Closed
is related to CSHARP-4889 Support Linux distros using libdl.so.2 Backlog
Assigned Teams:
Server Development Platform
Participants:
Case:

 Description   

This is related to SERVER-36790, but a more specific use case of Automatic CSFLE application running on Alpine that requires mongocryptd.

Limiting the scope of the build to only mongocryptd for Alpine



 Comments   
Comment by Ben Luk [ 04/Aug/22 ]

hi I have successfully started in docker container but unable to telnet from host ( I have blinded port -p 27020:27020)

Comment by Maor Davidzon [ 10/Mar/22 ]

I am facing the same issue.

Any progress?

 

Comment by Guilherme Terra [ 14/Oct/21 ]

Hi, 

Please, how can I install mongocryptd in an Alpine based Docker container with node:14?

I'm trying to build it following the steps defined in [https://github.com/mongodb/libmongocrypt,] but it fails when the mongodb-client-encryption dependency is being built. These are the errors:

/node_modules/mongodb-client-encryption/deps/lib/libmongocrypt-static.a: No such file or directory
/node_modules/mongodb-client-encryption/deps/lib/libkms_message-static.a: No such file or directory
/node_modules/mongodb-client-encryption/deps/lib/libbson-static-1.0.a: No such file or directory

This is the part of my Dockerfile in which I'm trying to build it:

FROM node:14-alpine
 
RUN apk add git make cmake g++ libbson-static musl-dev libc-dev openssl openssl-dev py3-pip
 
RUN git clone https://github.com/mongodb/mongo-c-driver
WORKDIR mongo-c-driver
RUN mkdir cmake-build
WORKDIR cmake-build
RUN cmake -DENABLE_MONGOC=OFF ../
RUN make -j8 install
 
 
WORKDIR ./
RUN git clone https://github.com/mongodb/libmongocrypt
WORKDIR libmongocrypt
RUN mkdir cmake-build 
WORKDIR cmake-build
RUN cmake
RUN make install

Thank you.

 

Comment by David Stewart [ 24/Nov/20 ]

Any progress on this from the mongo db team?

Comment by Mark Benvenuto [ 05/Aug/20 ]

I was able to build the mongocryptd and the server with only minimal changes on Alpine Linux. See for all the needed changes: https://github.com/markbenvenuto/mongo/commit/3587a38205289d6582f7e688e4cccba29e30d69a.

FROM alpine:latest
RUN apk add py3-pip gcc scons python3 git py3-psutil py3-yaml g++ openssl-dev curl-dev py3-cheetah linux-headers openssh bash xz-dev netsnmp-dev cyrus-sasl-dev openldap-dev krb5-dev

Since this was with GCC 9, I needed to disable one noisy warning to quiet the build.
python3 buildscripts/scons.py --disable-warnings-as-errors CFLAGS="-Wno-redundant-move" --allocator=system install-core install-mongocryptd

Generated at Thu Feb 08 05:19:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.