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 d252240adc781c3690589d8fbd698351c0492d08..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..0269048af2d1395c46516021b5695a98220c2319 --- /dev/null +++ b/Others/npm/11.4.2/24.03-lts-sp1/Dockerfile @@ -0,0 +1,13 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp1 +FROM ${BASE} +ARG VERSION=11.4.2 + +RUN dnf update -y \ + && dnf install nodejs -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf + +# `install.sh` installs the latest npm version +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 0000000000000000000000000000000000000000..fc8c5b77acbaffa841dd71e5d069e9b705d88f10 --- /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 0000000000000000000000000000000000000000..92cdcbbd2c881e4b6bfc2ddc092ec3175186d757 --- /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 Binary files /dev/null and b/Others/npm/doc/picture/logo.png differ diff --git a/Others/npm/meta.yml b/Others/npm/meta.yml index c05777bf0b49b512759c6d24b06515b798151fdb..82d06cd7d5b5a631fad32182badbf5ebec03bb92 100644 --- a/Others/npm/meta.yml +++ b/Others/npm/meta.yml @@ -1,3 +1,3 @@ -11.4.0-oe2403sp1: - path: 11.4.0/24.03-lts-sp1/Dockerfile +11.4.2-oe2403sp1: + path: 11.4.2/24.03-lts-sp1/Dockerfile