From 26255f76cbc30358cffcc8672aaec1b76d7ea124 Mon Sep 17 00:00:00 2001 From: GuangJie1 Date: Mon, 23 Jun 2025 11:37:14 +0800 Subject: [PATCH 1/2] add npm readme --- Others/npm/11.4.0/24.03-lts-sp1/Dockerfile | 12 ---- Others/npm/11.4.2/24.03-lts-sp1/Dockerfile | 12 ++++ Others/npm/README.md | 65 +++++++++++++++++++++ Others/npm/doc/image-info.yml | 59 +++++++++++++++++++ Others/npm/doc/picture/logo.png | Bin 0 -> 10558 bytes Others/npm/meta.yml | 4 +- 6 files changed, 138 insertions(+), 14 deletions(-) delete mode 100644 Others/npm/11.4.0/24.03-lts-sp1/Dockerfile create mode 100644 Others/npm/11.4.2/24.03-lts-sp1/Dockerfile create mode 100644 Others/npm/README.md create mode 100644 Others/npm/doc/image-info.yml create mode 100644 Others/npm/doc/picture/logo.png diff --git a/Others/npm/11.4.0/24.03-lts-sp1/Dockerfile b/Others/npm/11.4.0/24.03-lts-sp1/Dockerfile deleted file mode 100644 index d252240a..00000000 --- a/Others/npm/11.4.0/24.03-lts-sp1/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -ARG BASE=openeuler/openeuler:24.03-lts-sp1 -FROM ${BASE} as BUILDER -ARG VERSION=11.4.0 -ARG NVM_VERSION=0.40.3 -ARG NODE_VERSION=22 - -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash \ - && source "$HOME/.nvm/nvm.sh" \ - && nvm install ${NODE_VERSION} \ - && npm install -g npm@${VERSION} - -CMD ["npm", "-v"] diff --git a/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile b/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile new file mode 100644 index 00000000..a41f524a --- /dev/null +++ b/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile @@ -0,0 +1,12 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp1 +FROM ${BASE} as BUILDER +ARG VERSION=11.4.2 + +RUN dnf update -y \ + && dnf install nodejs -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf + + RUN curl -qL https://www.npmjs.com/install.sh | sh + +CMD ["npm", "-v"] diff --git a/Others/npm/README.md b/Others/npm/README.md new file mode 100644 index 00000000..fc8c5b77 --- /dev/null +++ b/Others/npm/README.md @@ -0,0 +1,65 @@ +# Quick reference + +- The official npm docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). + +# npm | openEuler +Current npm docker images are built on the [openEuler](https://repo.openeuler.org/). This repository is free to use and exempted from per-user rate limits. + +npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well. + +Learn more about npm on [npm Website](https://docs.npmjs.com/about-npm)⁠. + +# Supported tags and respective Dockerfile links +The tag of each `npm` docker image is consist of the version of `npm` and the version of basic image. The details are as follows + +| Tag | Currently | Architectures | +|----------|-------------|------------------| +|[11.4.2-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile)| npm 11.4.2 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +# Usage +In this usage, users can select the corresponding `{Tag}` based on their requirements. + +- Pull the `openeuler/npm` image from docker + + ```bash + docker pull openeuler/npm:{Tag} + ``` + +- Run with an interactive shell + + You can also start the container with an interactive shell to use npm. + ``` + docker run -it --rm openeuler/npm:{Tag} bash + ``` + +- Using npm CLI + + To install the latest version of a module from the npm registry. + ``` + npm install + ``` + + Example: + ``` + npm install sax + ``` + Key features: + * Omitting the version tag (`@latest`) defaults to installing the latest stable version. + * The command automatically retrieves the package tagged as `latest` in the registry. + +>[!WARNING] +>Do not run `npm install` in root directory (`/`). This will cause dependency resolution errors. + +- View all available commands: + + Refer to the complete [npm CLI documentation](https://docs.npmjs.com/cli/v11/commands/npm) + ``` + npm help + ``` + +# Question and answering +If you have any questions or want to use some special features, please submit an issue or a pull request on [openeuler-docker-images](https://gitee.com/openeuler/openeuler-docker-images). \ No newline at end of file diff --git a/Others/npm/doc/image-info.yml b/Others/npm/doc/image-info.yml new file mode 100644 index 00000000..92cdcbbd --- /dev/null +++ b/Others/npm/doc/image-info.yml @@ -0,0 +1,59 @@ +name: npm +category: others +description: npm(Node Package Manager)是 Node.js 的官方包管理工具。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + npm镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[11.4.2-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile)| npm 11.4.2 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/npm:{Tag} + ``` + +usage: | + - 以交互式Shell运行容器: + + 通过交互式 Shell 启动容器,使用npm命令: + ``` + docker run -it --rm openeuler/npm:{Tag} bash + ``` + + - 使用npm CLI + + 安装 npm 仓库中的最新版本模块: + ``` + npm install + ``` + + 示例: + ``` + npm install sax + ``` + 说明: + * 省略版本标签(如 @latest)时,默认安装最新的稳定版本 + * 该命令会自动获取 npm 仓库中标记为 latest 的包 + >[!WARNING] + >Do not run `npm install` in root directory (`/`). This will cause dependency resolution errors. + + - 查看所有可用命令: + 参考完整的 [npm CLI 文档](https://docs.npmjs.com/cli/v11/commands/npm) + ``` + npm help + ``` + +license: Artistic License 2.0 +similar_packages: + - yarn: Yarn(Yet Another Resource Negotiator)是 Facebook 推出的 JavaScript 包管理工具,旨在优化 npm 的依赖管理流程。 +dependency: + - nodejs + - openssl + - ca-certificates diff --git a/Others/npm/doc/picture/logo.png b/Others/npm/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..99bf4266a9d8d2433e0f09246f96c59245465376 GIT binary patch literal 10558 zcmeHNdrTBZ7@s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MK|`z zvv(PsG!`LDkUR~CRKjD~{a%aQ#ORiueanK;hQe*p!kmdph@5Cc@dEBReB^2JDkc5p z6y&+?N`aZuN;X88Xhr+vF(S3;5p#&G_ao<&Padz+dLTT76V&n#mJJG*lx_?hylrV?zOqsmP>mh+vjXAD?GFDh;2cT zdsgI5*zntV|&lPigUMOBR>$78iW{wwTo3 zYE14yYm!a;HW9p=VYDUd6j^k_S^F@;&VRxu4DaOZUzP0F>I^+~E;{GylHvQ4w Date: Mon, 23 Jun 2025 11:44:02 +0800 Subject: [PATCH 2/2] update dockerfile --- Others/npm/11.4.2/24.03-lts-sp1/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile b/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile index a41f524a..0269048a 100644 --- a/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile +++ b/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile @@ -1,5 +1,5 @@ ARG BASE=openeuler/openeuler:24.03-lts-sp1 -FROM ${BASE} as BUILDER +FROM ${BASE} ARG VERSION=11.4.2 RUN dnf update -y \ @@ -7,6 +7,7 @@ RUN dnf update -y \ && dnf clean all \ && rm -rf /var/cache/dnf - RUN curl -qL https://www.npmjs.com/install.sh | sh +# `install.sh` installs the latest npm version +RUN curl -qL https://www.npmjs.com/install.sh | sh CMD ["npm", "-v"] -- Gitee