From 10922858877382ee4ae110e3c0d1e518e443c7e8 Mon Sep 17 00:00:00 2001 From: Bhunter <180028024+bhunter234@users.noreply.github.com> Date: Sun, 1 Sep 2024 10:24:52 +0000 Subject: [PATCH] feat: added node --- .github/workflows/node.yml | 189 ++++++++++++++++++++ .github/workflows/postgres.yml | 44 +++-- node/.dockerignore | 4 + node/Dockerfile | 82 +++++++++ node/Makefile | 32 ++++ node/README.md | 79 ++++++++ node/build.sh | 101 +++++++++++ node/patch.sh | 23 +++ node/patches/v8-cppgc-shared-no-lto.patch | 23 +++ node/patches/v8-missing-elf-arm32v6-7.patch | 11 ++ postgres/Dockerfile | 4 +- postgres/build.sh | 1 - 12 files changed, 576 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/node.yml create mode 100644 node/.dockerignore create mode 100644 node/Dockerfile create mode 100644 node/Makefile create mode 100644 node/README.md create mode 100755 node/build.sh create mode 100755 node/patch.sh create mode 100644 node/patches/v8-cppgc-shared-no-lto.patch create mode 100644 node/patches/v8-missing-elf-arm32v6-7.patch diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..e8d0ac7 --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,189 @@ +name: node + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: + +env: + DOCKER_CLI_EXPERIMENTAL: enabled + REPOSITORY: tgdrive/${{ github.workflow }} + +permissions: + packages: write + +jobs: + fetch-versions: + runs-on: ubuntu-latest + outputs: + latest: ${{ steps.versions.outputs.latest }} + lts: ${{ steps.versions.outputs.lts }} + steps: + - name: Fetch Node.js versions + id: versions + run: | + LATEST=$(curl -s https://nodejs.org/dist/index.json | jq -r '[.[] | select(.lts == false)][0].version') + LTS=$(curl -s https://nodejs.org/dist/index.json | jq -r '[.[] | select(.lts != false)][0].version') + echo "latest=${LATEST#v}" >> $GITHUB_OUTPUT + echo "lts=${LTS#v}" >> $GITHUB_OUTPUT + + check-existing-images: + needs: fetch-versions + runs-on: ubuntu-latest + outputs: + build_latest: ${{ steps.check.outputs.build_latest }} + build_lts: ${{ steps.check.outputs.build_lts }} + steps: + - name: Check existing images + id: check + run: | + LATEST_VERSION=${{ needs.fetch-versions.outputs.latest }} + LTS_VERSION=${{ needs.fetch-versions.outputs.lts }} + + check_image() { + REPO="ghcr.io/${{ env.REPOSITORY }}" + TAG="$1" + curl -s -f -L -I -o /dev/null -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://ghcr.io/v2/${REPO#ghcr.io/}/manifests/${TAG}" && echo "exists" || echo "not_exists" + } + + LATEST_EXISTS=$(check_image $LATEST_VERSION) + LTS_EXISTS=$(check_image $LTS_VERSION) + + echo "build_latest=$([[ $LATEST_EXISTS == "not_exists" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT + echo "build_lts=$([[ $LTS_EXISTS == "not_exists" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT + + build-and-push: + needs: [fetch-versions, check-existing-images] + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64] + version_type: [latest, lts] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepare tags and cache keys + id: prep + run: | + if [[ "${{ matrix.version_type }}" == "latest" ]]; then + VERSION=${{ needs.fetch-versions.outputs.latest }} + BUILD_CONDITION=${{ needs.check-existing-images.outputs.build_latest }} + else + VERSION=${{ needs.fetch-versions.outputs.lts }} + BUILD_CONDITION=${{ needs.check-existing-images.outputs.build_lts }} + fi + + MAJOR_VERSION=$(echo $VERSION | cut -d. -f1) + TAGS="ghcr.io/${{ env.REPOSITORY }}:${VERSION}-${{ matrix.arch }}" + TAGS="${TAGS},ghcr.io/${{ env.REPOSITORY }}:${MAJOR_VERSION}-${{ matrix.arch }}" + + if [[ "${{ matrix.version_type }}" == "lts" ]]; then + TAGS="${TAGS},ghcr.io/${{ env.REPOSITORY }}:lts-${{ matrix.arch }}" + fi + + if [[ "${{ matrix.version_type }}" == "latest" ]]; then + TAGS="${TAGS},ghcr.io/${{ env.REPOSITORY }}:latest-${{ matrix.arch }}" + fi + + CACHE_FROM="type=gha,scope=${{ github.workflow }}-${{ matrix.version_type }}-${{ matrix.arch }}" + CACHE_TO="type=gha,scope=${{ github.workflow }}-${{ matrix.version_type }}-${{ matrix.arch }}" + + echo "tags=${TAGS}" >> $GITHUB_OUTPUT + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT + echo "build_condition=${BUILD_CONDITION}" >> $GITHUB_OUTPUT + echo "cache_from=${CACHE_FROM}" >> $GITHUB_OUTPUT + echo "cache_to=${CACHE_TO}" >> $GITHUB_OUTPUT + + - name: Set Docker metadata + id: docker_meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REPOSITORY }} + labels: | + org.opencontainers.image.version=${{ steps.prep.outputs.version }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.title=${{ env.REPOSITORY }} + org.opencontainers.image.description="Node.js Distroless image" + + - name: Build and push image + uses: docker/build-push-action@v6 + if: steps.prep.outputs.build_condition == 'true' + with: + context: ./node + push: true + provenance: false + labels: ${{ steps.docker_meta.outputs.labels }} + build-args: | + version=${{ steps.prep.outputs.version }} + arch=${{ matrix.arch == 'arm64' && 'arm64v8' || matrix.arch }} + cache-from: ${{ steps.prep.outputs.cache_from }} + cache-to: ${{ steps.prep.outputs.cache_to }} + tags: ${{ steps.prep.outputs.tags }} + + + create-and-push-manifest: + needs: [fetch-versions, check-existing-images, build-and-push] + runs-on: ubuntu-latest + strategy: + matrix: + version_type: [latest, lts] + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create and push manifests + run: | + if [[ "${{ matrix.version_type }}" == "latest" ]]; then + VERSION=${{ needs.fetch-versions.outputs.latest }} + BUILD_CONDITION=${{ needs.check-existing-images.outputs.build_latest }} + else + VERSION=${{ needs.fetch-versions.outputs.lts }} + BUILD_CONDITION=${{ needs.check-existing-images.outputs.build_lts }} + fi + + if [[ "${BUILD_CONDITION}" != "true" ]]; then + echo "Skipping manifest creation for ${{ matrix.version_type }} as it was not built" + exit 0 + fi + + MAJOR_VERSION=$(echo $VERSION | cut -d. -f1) + + create_and_push_manifest() { + local TAG=$1 + docker manifest create --amend ghcr.io/${{ env.REPOSITORY }}:${TAG} \ + ghcr.io/${{ env.REPOSITORY }}:${VERSION}-amd64 + + docker manifest annotate --os linux --arch amd64 ghcr.io/${{ env.REPOSITORY }}:${TAG} ghcr.io/${{ env.REPOSITORY }}:${VERSION}-amd64 + #docker manifest annotate --os linux --arch arm64 ghcr.io/${{ env.REPOSITORY }}:${TAG} ghcr.io/${{ env.REPOSITORY }}:${VERSION}-arm64 + docker manifest push --purge ghcr.io/${{ env.REPOSITORY }}:${TAG} + } + + create_and_push_manifest ${VERSION} + + create_and_push_manifest ${MAJOR_VERSION} + + if [[ "${{ matrix.version_type }}" == "latest" ]]; then + create_and_push_manifest latest + else + create_and_push_manifest lts + fi diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml index 1e56cec..5d47ae9 100644 --- a/.github/workflows/postgres.yml +++ b/.github/workflows/postgres.yml @@ -1,12 +1,18 @@ -name: Build Postgres +name: postgres on: schedule: - cron: '0 0 1 * *' + workflow_dispatch: + +env: + BUILD_VERSION: "16-alpine" + DOCKER_CLI_EXPERIMENTAL: enabled + REPOSITORY: tgdrive/${{ github.workflow }} jobs: - build-postgres: + build: runs-on: ubuntu-latest permissions: packages: write @@ -15,10 +21,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -28,22 +34,30 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker meta - id: meta + + - name: Set Docker metadata + id: docker_meta uses: docker/metadata-action@v5 with: - images: ghcr.io/tgdrive/postgres - tags: | - latest - 16-alpine - + images: ${{ env.REPOSITORY }} + labels: | + org.opencontainers.image.version=${{ env.BUILD_VERSION }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.title=${{ env.REPOSITORY }} + - name: Build Image uses: docker/build-push-action@v6 with: context: ./postgres push: true platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + build-args: | + BUILD_VERSION + labels: ${{ steps.docker_meta.outputs.labels }} + sbom: true + provenance: true + cache-from: type=gha, scope=${{ github.workflow }} + cache-to: type=gha, scope=${{ github.workflow }} + tags: | + ghcr.io/${{ env.REPOSITORY }}:${{ env.BUILD_VERSION }} + ghcr.io/${{ env.REPOSITORY }}:latest diff --git a/node/.dockerignore b/node/.dockerignore new file mode 100644 index 0000000..8c2e73b --- /dev/null +++ b/node/.dockerignore @@ -0,0 +1,4 @@ +* +!build.sh +!patch.sh +!patches diff --git a/node/Dockerfile b/node/Dockerfile new file mode 100644 index 0000000..7f17c5f --- /dev/null +++ b/node/Dockerfile @@ -0,0 +1,82 @@ +FROM alpine:3.16.2 as builder + +RUN apk update +RUN apk add make g++ python3 gnupg curl file flex patch rsync texinfo + +ARG arch= +ENV BUILD_ARCH=$arch + +COPY build.sh / + +RUN curl -Lsq -o musl-cross-make.zip https://git.zv.io/toolchains/musl-cross-make/-/archive/ed72f5171e3d4a9e92026823cbfe93e795105763/musl-cross-make-ed72f5171e3d4a9e92026823cbfe93e795105763.zip \ + && unzip -q musl-cross-make.zip \ + && mv musl-cross-make-ed72f5171e3d4a9e92026823cbfe93e795105763 musl-cross-make \ + && $(/build.sh config_mak ${BUILD_ARCH:-""} /musl-cross-make/config.mak) \ + && cd /musl-cross-make \ + && make install -j$(getconf _NPROCESSORS_ONLN) V= \ + && rm -rf /musl-cross-make + +ARG version=0.0.0 +ENV NODE_VERSION=$version + +# gpg keys listed at https://github.com/nodejs/node#release-keys +RUN for key in \ + 4ED778F539E3634C779C87C6D7062848A1AB005C \ + 141F07595B7B3FFE74309A937405533BE57C7D57 \ + 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ + DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \ + CC68F5A3106FF448322E48ED27F5E38D5B0A215F \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ + C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ + 108F52B48DB57BB0CC439B2997B01419BD92F80A \ + A363A499291CBBC940DD62E41F10027AF002F8B0 \ + ; do \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ + && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - + +ADD patch.sh / +ADD patches /patches + +RUN tar -xf "node-v$NODE_VERSION.tar.xz" \ + && cd "node-v$NODE_VERSION" \ + && /patch.sh ${BUILD_ARCH} ${NODE_VERSION} \ + && export TARGET=$(/build.sh target ${BUILD_ARCH:-""}) \ + && export CC=$TARGET-gcc \ + && export CXX=$TARGET-g++ \ + && export AR=$TARGET-ar \ + && export NM=$TARGET-nm \ + && export RANLIB=$TARGET-ranlib \ + && export LINK=$TARGET-g++ \ + && export CXXFLAGS="-O3 -ffunction-sections -fdata-sections" \ + && export LDFLAGS="-Wl,--gc-sections,--strip-all $(/build.sh ld_flags ${BUILD_ARCH:-""})" \ + && ln -snf libc.so /usr/local/$TARGET/lib/ld-musl-*.so.1 \ + && ln -snf /usr/local/$TARGET/lib/ld-musl-*.so.1 /lib \ + && ./configure \ + --partly-static \ + --with-intl=small-icu \ + --without-inspector \ + $(/build.sh node_config ${BUILD_ARCH:-""}) \ + && make -j$(getconf _NPROCESSORS_ONLN) V= + +RUN echo 'node:x:1000:1000:Linux User,,,:/home/node:/bin/sh' > /tmp/passwd + +FROM scratch + +ARG version=0.0.0 + +LABEL org.opencontainers.image.source="https://github.com/astefanutti/scratch-node" + +COPY --from=builder node-v$version/out/Release/node /bin/node +COPY --from=builder /lib/ld-musl-*.so.1 /lib/ +COPY --from=builder /tmp/passwd /etc/passwd + +USER node + +ENTRYPOINT ["node"] diff --git a/node/Makefile b/node/Makefile new file mode 100644 index 0000000..b69d7b3 --- /dev/null +++ b/node/Makefile @@ -0,0 +1,32 @@ +PREFIX?=tgdrive +REPOSITORIES?= ghcr.io/$(PREFIX) +VERSION?=22.5.1 + +ARCHITECTURES=amd64 arm64v8 + +tag-images: + @for arch in $(ARCHITECTURES); do docker tag $(PREFIX)/scratch-node:${VERSION}-$${arch} $(PREFIX)/scratch-node:${TAG}-$${arch}; done + +move-images: + @for repo in $(REPOSITORIES); do \ + for arch in $(ARCHITECTURES); do \ + docker tag $(PREFIX)/scratch-node:${VERSION}-$${arch} $${repo}/scratch-node:${VERSION}-$${arch}; \ + done \ + done + +build-images: + @for arch in $(ARCHITECTURES); do docker build --progress=auto --build-arg version=${VERSION} --build-arg arch=$${arch} -t $(PREFIX)/scratch-node:${VERSION}-$${arch} .; done + +push-images: + @for arch in $(ARCHITECTURES); do docker push $(PREFIX)/scratch-node:${VERSION}-$${arch}; done + +create-manifest: push-images + docker manifest create --amend $(PREFIX)/scratch-node:$(VERSION) $(shell echo $(ARCHITECTURES) | sed -e "s~[^ ]*~$(PREFIX)/scratch-node:$(VERSION)\-&~g") + docker manifest annotate --os linux --arch amd64 $(PREFIX)/scratch-node:${VERSION} $(PREFIX)/scratch-node:${VERSION}-amd64 + # TODO: set the CPU features as soon as the CLI exposes a --features option + docker manifest annotate --os linux --arch arm --variant v6 $(PREFIX)/scratch-node:${VERSION} $(PREFIX)/scratch-node:${VERSION}-arm32v6 + docker manifest annotate --os linux --arch arm --variant v7 $(PREFIX)/scratch-node:${VERSION} $(PREFIX)/scratch-node:${VERSION}-arm32v7 + docker manifest annotate --os linux --arch arm64 --variant v8 $(PREFIX)/scratch-node:${VERSION} $(PREFIX)/scratch-node:${VERSION}-arm64v8 + +push-manifest: create-manifest + docker manifest push --purge $(PREFIX)/scratch-node:${VERSION} diff --git a/node/README.md b/node/README.md new file mode 100644 index 0000000..2b9f487 --- /dev/null +++ b/node/README.md @@ -0,0 +1,79 @@ +# Node.js Static Docker Images + +Multi-architecture distroless Node.js Docker images. + +## Content + +* The Node.js binary, statically linked using [_musl_](https://musl.libc.org), with opt-in support for i18n data +* The _musl_ dynamic linker, to support native modules +* A `/etc/passwd` entry for a `node` user + +## Images + +Multi-architecture images for `amd64` and `arm64` +* Tags: `latest`, `lts` + +## Usage + +```dockerfile +FROM node as builder + +WORKDIR /app + +COPY package.json package-lock.json index.js ./ + +RUN npm install --prod + +FROM ghcr.io/tgdrive/node + +COPY --from=builder /app / + +ENTRYPOINT ["node", "index.js"] +``` + +### Native modules + +Native modules need to be statically compiled with _musl_ to be loadable. +This can easily be achieved by updating the above example with: + +```dockerfile +FROM node:alpine as builder + +RUN apk update && apk add make g++ python + +WORKDIR /app + +COPY package.json package-lock.json index.js ./ + +RUN LDFLAGS='-static-libgcc -static-libstdc++' npm install --build-from-source= + +FROM ghcr.io/tgdrive/node + +COPY --from=builder /app / + +ENTRYPOINT ["node", "index.js"] +``` + +### Internationalization + +The Node binaries are linked against the ICU library statically, and include a subset of ICU data (typically only the English locale) to keep the image sizes small. +Additional locales data can be provided if needed, so that methods work for all ICU locales. +It can be made available to ICU by retrieving the locales data from the ICU sources, e.g.: + +```dockerfile +FROM alpine as builder + +RUN apk update && apk add curl + +# Note the exact version of icu4c that's compatible depends on the Node version! +RUN curl -Lsq -o icu4c-71_1-src.zip https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.zip \ + && unzip -q icu4c-71_1-src.zip + +FROM ghcr.io/tgdrive/node + +COPY --from=builder /icu/source/data/in/icudt71l.dat /icu/ + +ENV NODE_ICU_DATA=/icu +``` + +More information can be found in the [Providing ICU data at runtime](https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime) from the Node.js documentation. \ No newline at end of file diff --git a/node/build.sh b/node/build.sh new file mode 100755 index 0000000..49ef74a --- /dev/null +++ b/node/build.sh @@ -0,0 +1,101 @@ +#!/bin/sh + +set -eu + +target() { + local arch="$1" + case "${arch}" in + "x64" | "x86_64" | "amd64" | "") + echo "x86_64-linux-musl" + ;; + "arm32v6") + echo "armv6-linux-musleabihf" + ;; + "arm32v7") + echo "armv7-linux-musleabihf" + ;; + "arm64v8") + echo "aarch64-linux-musl" + ;; + *) + >&2 echo Unsupported architecture: "${arch}" + exit 1 + ;; + esac +} + +ld_flags() { + local arch="$1" + case "${arch}" in + "arm32v6") + echo "-Wl,-Bstatic,-latomic,-rpath=/usr/local/armv6-linux-musleabihf/lib" + ;; + "arm32v7") + echo "-Wl,-Bstatic,-latomic,-rpath=/usr/local/armv7-linux-musleabihf/lib" + ;; + "" | *) + echo "" + ;; + esac +} + +gcc_config() { + local arch="$1" + case "${arch}" in + "arm32v6") + echo "--with-arch=armv6zk+fp --with-tune=arm1176jzf-s" + ;; + "arm32v7") + echo "--with-arch=armv7-a+neon-vfpv4 --with-tune=generic-armv7-a" + ;; + "" | *) + echo "" + ;; + esac +} + +config_mak() { + local arch="$1" + cat > $2 <<-EOF + MUSL_VER = 1.2.3 + GCC_VER = 11.3.0 + BINUTILS_VER = 2.38 + GMP_VER = 6.2.1 + MPC_VER = 1.2.1 + MPFR_VER = 4.1.0 + LINUX_VER = 5.15.2 + TARGET=$(target ${BUILD_ARCH:-""}) + OUTPUT=/usr/local + GCC_CONFIG=$(gcc_config $arch) --enable-languages=c,c++ + BINUTILS_CONFIG=--enable-gold --enable-lto + EOF +} + +node_config() { + local arch="$1" + case "${arch}" in + "x64" | "x86_64" | "amd64") + echo "--enable-lto" + ;; + "arm32v6") + echo "--with-arm-float-abi=hard --with-arm-fpu=vfp" + ;; + "arm32v7") + echo "--with-arm-float-abi=hard --with-arm-fpu=vfpv3" + ;; + "arm64v8") + echo "--with-arm-float-abi=hard --with-arm-fpu=neon --enable-lto" + ;; + "" | *) + echo "" + ;; + esac +} + +call() { + local func="$1" + shift + ${func} "$@" +} + +call "$@" diff --git a/node/patch.sh b/node/patch.sh new file mode 100755 index 0000000..f173919 --- /dev/null +++ b/node/patch.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -eu + +apply() { + local arch="$1" + local version="$2" + + case "${version}" in + 13.10.*) + if [[ "$arch" = "arm32v6" ]] || [[ "$arch" = "arm32v7" ]]; then + patch -p0 < /patches/v8-missing-elf-arm32v6-7.patch + fi + ;; + 15.*.* | 16.*.* | 17.*.* | 18.*.*) + patch -p0 < /patches/v8-cppgc-shared-no-lto.patch + ;; + *) + ;; + esac +} + +apply "$@" diff --git a/node/patches/v8-cppgc-shared-no-lto.patch b/node/patches/v8-cppgc-shared-no-lto.patch new file mode 100644 index 0000000..3c8170c --- /dev/null +++ b/node/patches/v8-cppgc-shared-no-lto.patch @@ -0,0 +1,23 @@ +--- tools/v8_gypfiles/v8.gyp ++++ tools/v8_gypfiles/v8.gyp +@@ -1592,9 +1592,9 @@ + }, # v8_bigint + { + 'target_name': 'v8_heap_base', +- 'type': 'none', ++ 'type': 'static_library', + 'toolsets': ['host', 'target'], +- 'direct_dependent_settings': { ++ # 'direct_dependent_settings': { + 'sources': [ + '<(V8_ROOT)/src/heap/base/active-system-pages.cc', + '<(V8_ROOT)/src/heap/base/stack.cc', +@@ -1678,7 +1678,7 @@ + ], + }], + ], +- }, ++ # }, + }, # v8_heap_base + + ############################################################################### diff --git a/node/patches/v8-missing-elf-arm32v6-7.patch b/node/patches/v8-missing-elf-arm32v6-7.patch new file mode 100644 index 0000000..ea9cf3f --- /dev/null +++ b/node/patches/v8-missing-elf-arm32v6-7.patch @@ -0,0 +1,11 @@ +--- deps/v8/src/base/cpu.orig.cc 2020-03-07 14:44:14.000000000 +0100 ++++ deps/v8/src/base/cpu.cc 2020-03-07 14:44:36.000000000 +0100 +@@ -17,7 +17,7 @@ + #if V8_OS_QNX + #include // cpuinfo + #endif +-#if (V8_OS_LINUX && V8_HOST_ARCH_PPC) || V8_OS_ANDROID ++#if V8_OS_LINUX || V8_OS_ANDROID + #include + #endif + #if V8_OS_AIX diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 011c7c2..1f971f3 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,5 +1,7 @@ -FROM postgres:16-alpine +ARG BUILD_VERSION=16-alpine + +FROM postgres:${BUILD_VERSION} ARG PGROONGA_VERSION=3.2.1 ARG GROONGA_VERSION=14.0.5 diff --git a/postgres/build.sh b/postgres/build.sh index abc06d1..3f93c4d 100644 --- a/postgres/build.sh +++ b/postgres/build.sh @@ -1,7 +1,6 @@ #!/bin/bash set -eux - MECAB_VERSION=0.996 mkdir build