From 35b2edce1a869694fcfb7ed27e8a9315dbfd606a Mon Sep 17 00:00:00 2001 From: abeimler Date: Tue, 18 Apr 2023 13:37:21 +0200 Subject: [PATCH] fix: docker builds --- dev/docker/arch_node.dockerfile | 4 ++-- dev/docker/fedora_node.dockerfile | 4 ++-- dev/docker/ubuntu.dockerfile | 3 +-- dev/docker/ubuntu_20.04_node.dockerfile | 6 +++++- dev/docker/ubuntu_20.04_node_legacy.dockerfile | 9 +++++++-- dev/docker/ubuntu_node.dockerfile | 5 ++++- dev/docker/ubuntu_node_legacy.dockerfile | 3 +-- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dev/docker/arch_node.dockerfile b/dev/docker/arch_node.dockerfile index baa1b0ef..55359cd2 100644 --- a/dev/docker/arch_node.dockerfile +++ b/dev/docker/arch_node.dockerfile @@ -5,7 +5,7 @@ RUN pacman -Syuu --noconfirm RUN pacman-db-upgrade # install nodejs -RUN pacman -S --noconfirm --needed nodejs +RUN pacman -S --noconfirm --needed nodejs npm git # install pnpm #RUN pacman -S --noconfirm --needed pnpm @@ -25,7 +25,7 @@ FROM base AS setup-cpp # add setup-cpp.js COPY --from=builder /workspace/dist/node18 / # run installation -RUN . $NVM_DIR/nvm.sh && node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true +RUN node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true CMD ["source", "~/.cpprc"] ENTRYPOINT ["/bin/bash"] diff --git a/dev/docker/fedora_node.dockerfile b/dev/docker/fedora_node.dockerfile index 9a092256..0f58e33e 100644 --- a/dev/docker/fedora_node.dockerfile +++ b/dev/docker/fedora_node.dockerfile @@ -2,7 +2,7 @@ FROM fedora as base # nodejs and curl for downloading setup-cpp -RUN dnf -y install nodejs curl +RUN dnf -y install nodejs npm curl git # install pnpm RUN npm install -g pnpm @@ -21,7 +21,7 @@ FROM base AS setup-cpp # add setup-cpp.js COPY --from=builder /workspace/dist/node18 / # run installation -RUN . $NVM_DIR/nvm.sh && node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true +RUN node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true CMD ["source", "~/.cpprc"] ENTRYPOINT ["/bin/bash"] diff --git a/dev/docker/ubuntu.dockerfile b/dev/docker/ubuntu.dockerfile index 7ddb1d7f..38356319 100644 --- a/dev/docker/ubuntu.dockerfile +++ b/dev/docker/ubuntu.dockerfile @@ -2,8 +2,7 @@ FROM ubuntu:22.04 as base # install setup-cpp -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends npm +RUN apt-get update -qq && apt-get install -y --no-install-recommends npm git curl RUN npm install -g setup-cpp # install llvm, cmake, ninja, and ccache diff --git a/dev/docker/ubuntu_20.04_node.dockerfile b/dev/docker/ubuntu_20.04_node.dockerfile index aabb8bd0..079b806f 100644 --- a/dev/docker/ubuntu_20.04_node.dockerfile +++ b/dev/docker/ubuntu_20.04_node.dockerfile @@ -20,7 +20,11 @@ ENV NODE_PATH $NVM_DIR/v${node_version}/lib/node_modules ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH # install pnpm -RUN npm install -g pnpm@7.32.0 +ENV PNPM_VERSION "7.32.0" +ADD https://get.pnpm.io/install.sh /tmp/pnpm_install.sh +RUN chmod +x /tmp/pnpm_install.sh && bash /tmp/pnpm_install.sh +ENV PNPM_HOME "/root/.local/share/pnpm" +ENV PATH "${PATH}:${PNPM_HOME}" #### Building diff --git a/dev/docker/ubuntu_20.04_node_legacy.dockerfile b/dev/docker/ubuntu_20.04_node_legacy.dockerfile index fee8363f..f54bd2d2 100644 --- a/dev/docker/ubuntu_20.04_node_legacy.dockerfile +++ b/dev/docker/ubuntu_20.04_node_legacy.dockerfile @@ -20,7 +20,11 @@ ENV NODE_PATH $NVM_DIR/v${node_version}/lib/node_modules ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH # install pnpm -RUN npm install -g pnpm@6.35.1 +ENV PNPM_VERSION "6.35.1" +ADD https://get.pnpm.io/install.sh /tmp/pnpm_install.sh +RUN chmod +x /tmp/pnpm_install.sh && bash /tmp/pnpm_install.sh +ENV PNPM_HOME "/root/.local/share/pnpm" +ENV PATH "${PATH}:${PNPM_HOME}" #### Building @@ -28,7 +32,8 @@ FROM base AS builder ## https://github.com/ever0de/pnpm-docker-root-bug#how-to-fix WORKDIR /workspace COPY . . -RUN pnpm install +## WARN  "prepare" script of "setup-cpp" inside "/workspace" is skipped as the working directory seems suspicious. To run this lifecycle script anyway, use "--unsafe-perm". +RUN pnpm install --unsafe-perm #### setup-cpp diff --git a/dev/docker/ubuntu_node.dockerfile b/dev/docker/ubuntu_node.dockerfile index 0b5b96af..8d207bc8 100644 --- a/dev/docker/ubuntu_node.dockerfile +++ b/dev/docker/ubuntu_node.dockerfile @@ -16,7 +16,10 @@ ENV NODE_PATH $NVM_DIR/v${node_version}/lib/node_modules ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH # install pnpm -RUN npm install -g pnpm +ADD https://get.pnpm.io/install.sh /tmp/pnpm_install.sh +RUN chmod +x /tmp/pnpm_install.sh && bash /tmp/pnpm_install.sh +ENV PNPM_HOME "/root/.local/share/pnpm" +ENV PATH "${PATH}:${PNPM_HOME}" #### Building diff --git a/dev/docker/ubuntu_node_legacy.dockerfile b/dev/docker/ubuntu_node_legacy.dockerfile index ea449aa7..c7f41f69 100644 --- a/dev/docker/ubuntu_node_legacy.dockerfile +++ b/dev/docker/ubuntu_node_legacy.dockerfile @@ -1,7 +1,6 @@ FROM ubuntu:22.04 AS base -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends nodejs +RUN apt-get update -qq && apt-get install -y --no-install-recommends nodejs npm # install pnpm RUN npm install -g pnpm@6.35.1