fix: docker builds

This commit is contained in:
abeimler 2023-04-18 13:37:21 +02:00
parent 30c54f21f2
commit 35b2edce1a
7 changed files with 22 additions and 12 deletions

View File

@ -5,7 +5,7 @@ RUN pacman -Syuu --noconfirm
RUN pacman-db-upgrade RUN pacman-db-upgrade
# install nodejs # install nodejs
RUN pacman -S --noconfirm --needed nodejs RUN pacman -S --noconfirm --needed nodejs npm git
# install pnpm # install pnpm
#RUN pacman -S --noconfirm --needed pnpm #RUN pacman -S --noconfirm --needed pnpm
@ -25,7 +25,7 @@ FROM base AS setup-cpp
# add setup-cpp.js # add setup-cpp.js
COPY --from=builder /workspace/dist/node18 / COPY --from=builder /workspace/dist/node18 /
# run installation # 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"] CMD ["source", "~/.cpprc"]
ENTRYPOINT ["/bin/bash"] ENTRYPOINT ["/bin/bash"]

View File

@ -2,7 +2,7 @@
FROM fedora as base FROM fedora as base
# nodejs and curl for downloading setup-cpp # nodejs and curl for downloading setup-cpp
RUN dnf -y install nodejs curl RUN dnf -y install nodejs npm curl git
# install pnpm # install pnpm
RUN npm install -g pnpm RUN npm install -g pnpm
@ -21,7 +21,7 @@ FROM base AS setup-cpp
# add setup-cpp.js # add setup-cpp.js
COPY --from=builder /workspace/dist/node18 / COPY --from=builder /workspace/dist/node18 /
# run installation # 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"] CMD ["source", "~/.cpprc"]
ENTRYPOINT ["/bin/bash"] ENTRYPOINT ["/bin/bash"]

View File

@ -2,8 +2,7 @@
FROM ubuntu:22.04 as base FROM ubuntu:22.04 as base
# install setup-cpp # install setup-cpp
RUN apt-get update -qq RUN apt-get update -qq && apt-get install -y --no-install-recommends npm git curl
RUN apt-get install -y --no-install-recommends npm
RUN npm install -g setup-cpp RUN npm install -g setup-cpp
# install llvm, cmake, ninja, and ccache # install llvm, cmake, ninja, and ccache

View File

@ -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 ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH
# install pnpm # 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 #### Building

View File

@ -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 ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH
# install pnpm # 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 #### Building
@ -28,7 +32,8 @@ FROM base AS builder
## https://github.com/ever0de/pnpm-docker-root-bug#how-to-fix ## https://github.com/ever0de/pnpm-docker-root-bug#how-to-fix
WORKDIR /workspace WORKDIR /workspace
COPY . . 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 #### setup-cpp

View File

@ -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 ENV PATH $NVM_DIR/versions/node/v${node_version}/bin:$PATH
# install pnpm # 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 #### Building

View File

@ -1,7 +1,6 @@
FROM ubuntu:22.04 AS base FROM ubuntu:22.04 AS base
RUN apt-get update -qq RUN apt-get update -qq && apt-get install -y --no-install-recommends nodejs npm
RUN apt-get install -y --no-install-recommends nodejs
# install pnpm # install pnpm
RUN npm install -g pnpm@6.35.1 RUN npm install -g pnpm@6.35.1