https://github.com/moontai0724/docker-pnpm
Docker Image for PNPM package manager.
https://github.com/moontai0724/docker-pnpm
docker docker-image dockerfile nodejs pnpm
Last synced: 2 months ago
JSON representation
Docker Image for PNPM package manager.
- Host: GitHub
- URL: https://github.com/moontai0724/docker-pnpm
- Owner: moontai0724
- Created: 2023-11-14T03:53:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-15T02:56:29.000Z (over 2 years ago)
- Last Synced: 2025-03-27T14:54:02.830Z (about 1 year ago)
- Topics: docker, docker-image, dockerfile, nodejs, pnpm
- Language: Shell
- Homepage: https://hub.docker.com/r/moontai0724/pnpm
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Image for PNPM
This is a docker image for [pnpm](https://pnpm.io/), which is flexible to adjust version of node and pnpm.
## Usage
To use this image, you can use it in two ways, but there will be a little different when using these two methods.
### 1. Directly use
```sh
docker run --rm -it -v $(pwd):/app moontai0724/pnpm:latest pnpm install
```
#### Update the pnpm to the latest version or a specific version
The image should contains latest pnpm version, but if you want to re-download when startup or use a specific version of pnpm, you can specify the `PNPM_VERSION` environment variable.
This image contains an [entrypoint script](https://docs.docker.com/engine/reference/builder/#entrypoint), which could run script when the image startup, that will re-download pnpm when startup.
```sh
docker run --rm -it -v $(pwd):/app -e PNPM_VERSION=7.33.6 moontai0724/pnpm:latest pnpm install
```
### 2. Use as a base image
```dockerfile
FROM moontai0724/pnpm
# your code
```
#### Update the pnpm to the latest version or a specific version
Please note that the entrypoint script will be executed after the image built, so you will use the pnpm version that is pre-installed in the image. If you want to use another version of pnpm, please manually run the installation script.
```dockerfile
FROM moontai0724/pnpm
RUN sh /run/install_pnpm.sh
# your code
```
If you want to install a specific version of pnpm, you can set the `PNPM_VERSION` environment variable.
```dockerfile
FROM moontai0724/pnpm
RUN export PNPM_VERSION=7.33.6
RUN sh /run/install_pnpm.sh
# your code
```
## Environment Variables
| Name | Default Value | Description |
| ------------ | ------------- | ---------------------------------------------------------------------------------------------------------------- |
| PNPM_VERSION | N/A | The version of pnpm to install. Specify `latest` to download latest version of pnpm. Will skip install if empty. |