Skip to content

marcaureln/docker-volta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Volta Docker Image

Build images Update Volta version

This repository contains Docker images for the Volta JavaScript tool manager.

Available tags and respective Dockerfile links

This list won't be updated as frequently as the tags. Check this page for all available tags.

Supported architectures

This image is built for amd64 and arm64.

Supported Node.js versions

All Node.js versions supported by Volta are supported by this image. Always make sure to pin a Node.js version in your package.json file. Learn more about pinning Node.js versions here.

What is Volta?

To quote their website:

The Hassle-Free JavaScript Tool Manager.

I can't say it better than that.

How to use this image

Create a Dockerfile in your project directory with the following content:

# You can specify the version of volta you want to use by changing the tag
FROM marcaureln/volta:latest

# Make sure to have a Node.js version pinned in your package.json (use `volta pin node` to pin a version)
COPY package.json ./
COPY package-lock.json ./

# Install dependencies using the pinned npm or yarn version
RUN npm install

# Copy the rest of your application
COPY . .

# Run your application
CMD ["npm", "start"]

Then build the Docker image:

docker build -t my-nodejs-app .

And run it:

docker run --rm -it my-nodejs-app

Image Variants

The marcaureln/volta images come in several flavors. The latest tag is always the latest version of Volta with the latest stable Debian version.

marcaureln/volta:<version>

The <version> refers to the Volta version you want to use. Version >= 2.0.0 are supported. When using this tag, the image will be based off of the latest stable Debian version.

marcaureln/volta:<version>-<flavor>

The <flavor> refers to the Debian version you want to use. The tags are based off of Debian's buildpack-deps images. The following flavors are available: bookworm, bullseye. Thereby, the following tags are available: <version>-bookworm, <version>-bullseye.

marcaureln/volta:<version>-<flavor>-slim

The slim variant is based off of Debian's slim images. The same flavors are available: bookworm, bullseye. Thereby, the following tags are available: <version>-bookworm-slim, <version>-bullseye-slim.

Why is there no Alpine variant?

Volta does not support Alpine Linux yet. See volta-cli/volta#473 for more information.

Acknowledgements

This Docker image is inspired by Michal Bryxí's article.

Special thanks to the Volta team for creating such a great tool.

License

This project is licensed under the MIT license.