nicoolandgood/volta.sh

By nicoolandgood

Updated over 1 year ago

Docker image for the volta.sh javascript toolchain.

Image
Languages & frameworks
Developer tools
Web servers
0

1.1K

nicoolandgood/volta.sh repository overview

Volta.sh Docker

This repository contains Docker images for the volta.sh toolchain.

Usage

Either build the image or pull it from the repository:

# Building
docker build . --tag volta.sh:latest

# Pulling
docker pull volta.sh:latest

You can then run it with:

docker run -d volta.sh:latest

Build arguments

In order to customize your image, you can pass arguments to docker before the building process.

VOLTA_USER

The user created inside the container. volta by default.

docker build --build-arg="VOLTA_USER=jotaro" .

Env variables

NODE_VERSION

The default node version installed when starting the image. latest by default.

# This will run volta install node@16.
docker run -d -e "NODE_VERSION=16" nicoolangood/volta.sh
PACKAGE_MANAGER

The default package manager used inside the container. Possible values are npm, yarn and pnpm, npm by default.

# This will run volta install yarn.
docker run -d -e "PACKAGE_MANAGER=yarn" nicoolangood/volta.sh
VOLTA_FEATURE_PNPM

This enables the pnpm support. Its value is set to 1 by default. You can find more information in the volta pnpm support page.

RUN_PACKAGE_MANAGER

This runs the default package manager if set to 1. If not, sleep infinity is run. Its value is set to 0 by default.

Before running the package manager, it will install dependencies as such:

# If pnpm is the default package manager
pnpm i
pnpm $@

Note that, by default, enabling this feature doesn't do much. It must be coupled with CMD override to pass arguments to the package manager:

# ...image customization

CMD ["start"]

will result to:

# If pnpm is the default package manager
pnpm i
pnpm start
PACKAGE_MANAGER_INSTALL_ARGS

This variable appends arguments during the dependencies installation.

It could be used to install only production dependencies:

docker build --build-arg="PACKAGE_MANAGER=yarn" .
docker run -d -e PACKAGE_MANAGER_INSTALL_ARGS='--production' volta.sh:latest

will result to:

yarn install --production
yarn [some command]

Entrypoint script

The entrypoint script is located in /entrypoint.sh. It can be replaced to personalize container start behavior.

Here is an example with docker compose:

services:
    web-app:
        image: volta.sh:latest

        volume:
            ./my-entrypoint.sh:/entrypoint.sh

Contribute

You can contribute to the image on Github.

Tag summary

Content type

Image

Digest

sha256:b79e76866

Size

65.7 MB

Last updated

over 1 year ago

docker pull nicoolandgood/volta.sh