57 lines · 2.2 KB · Text
RawDownload
# Copyright 2023 Overte e.V.# SPDX-License-Identifier: Apache-2.0 # Docker file for building Overte Node packages for Ubuntu 18.04 # Some steps for actually using this:# - Adjust this file to include the number of threads you want to use (-j10), and the Node version.#     Keep in mind that building Node requires a lot of memory. You should have over 1.2GiB of system memory available per thread.# - Run the build process with something like `PROGRESS_NO_TRUNC=1 DOCKER_BUILDKIT=1 BUILDKIT_STEP_LOG_MAX_SIZE=-1 docker build --progress plain -t overte-node:node-18.14.2 -f Dockerfile_Ubuntu_18.04_node .`#     Buildkit is used to cache intermittent steps in case you need to modify something afterwards.# - Once the build has completed, create a container from the image and export the created Node package.#     `docker create --name extract overte-node:node-18.14.2`#     `docker cp extract:node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz /path/on/host`#     `docker rm extract` FROM ubuntu:18.04LABEL maintainer="Julian Groß (julian.gro@overte.org)"LABEL description="Development image for Overte Node packages for Ubuntu 18.04." # Don't use any frontend when installalling packages during the creation of this containerARG DEBIAN_FRONTEND=noninteractive RUN echo UTC >/etc/timezone # Enable source repositories for aptRUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list # Update package listRUN apt-get update # Upgrade packagesRUN apt-get -y upgrade RUN apt-get -y install git # Clone and enter single branch of NodeRUN git clone --recursive https://github.com/nodejs/node.git -b v18.14.2 --single-branch  # Install node system build dependenciesRUN apt-get -y build-dep nodejs  RUN mkdir node-installWORKDIR node# --gdb currently doesn't build on aarch64# Ubuntu 18.04 has a too old compiler to build on aarch64#RUN ./configure --gdb --shared --prefix=../node-install/RUN ./configure --gdb --shared --debug --debug-lib --v8-with-dchecks --v8-enable-object-print --prefix=../node-install/ RUN make -j10RUN make -j10 install RUN cp config.status ../node-install/ WORKDIR ..RUN XZ_OPT='-T0' tar -Jcvf node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz node-install