| 1 | # Many linux dockerfile with Rust, Node, and Lance dependencies installed. |
| 2 | # This container allows building the node modules native libraries in an |
| 3 | # environment with a very old glibc, so that we are compatible with a wide |
| 4 | # range of linux distributions. |
| 5 | ARG ARCH=x86_64 |
| 6 | |
| 7 | FROM quay.io/pypa/manylinux_2_28_${ARCH} |
| 8 | |
| 9 | ARG ARCH=x86_64 |
| 10 | ARG DOCKER_USER=default_user |
| 11 | |
| 12 | # Install static openssl |
| 13 | COPY install_openssl.sh install_openssl.sh |
| 14 | RUN ./install_openssl.sh ${ARCH} > /dev/null |
| 15 | |
| 16 | # Protobuf is also installed as root. |
| 17 | COPY install_protobuf.sh install_protobuf.sh |
| 18 | RUN ./install_protobuf.sh ${ARCH} |
| 19 | |
| 20 | ENV DOCKER_USER=${DOCKER_USER} |
| 21 | # Create a group and user, but only if it doesn't exist |
| 22 | RUN echo ${ARCH} && id -u ${DOCKER_USER} >/dev/null 2>&1 || adduser --user-group --create-home --uid ${DOCKER_USER} build_user |
| 23 | |
| 24 | # We switch to the user to install Rust and Node, since those like to be |
| 25 | # installed at the user level. |
| 26 | USER ${DOCKER_USER} |
| 27 | |
| 28 | COPY prepare_manylinux_node.sh prepare_manylinux_node.sh |
| 29 | RUN cp /prepare_manylinux_node.sh $HOME/ && \ |
| 30 | cd $HOME && \ |
| 31 | ./prepare_manylinux_node.sh ${ARCH} |