Node.js

    Versions

    Currently, OKD provides versions , 4, and of Node.js.

    These images come in two flavors, depending on your needs:

    • RHEL 7

    RHEL 7 Based Images

    The RHEL 7 images are available through the Red Hat Registry:

    CentOS 7 Based Image

    This image is available on Docker Hub:

    To use these images, you can either access them directly from these image registries, or push them into your . Additionally, you can create an image stream that points to the image, either in your container image registry or at the external location. Your OKD resources can then reference the ImageStream. You can find for all the provided OKD images.

    Build Process

    1. Starts a container from the builder image.

    2. Downloads the application source.

    3. Streams the scripts and application sources into the builder image container.

    4. Saves the final image.

    See for a detailed overview of the build process.

    The Node.js image supports a number of environment variables, which can be set to control the configuration and behavior of the Node.js runtime.

    To set these environment variables as part of your image, you can place them into a .s2i/environment file inside your source code repository, or define them in of the build configuration’s definition.

    You can also set environment variables to be used with an existing image when creating new applications, or by such as deployment configurations.

    Hot Deploying

    Hot deployment allows you to quickly make and deploy changes to your application without having to generate a new S2I build. In order to immediately pick up changes made in your application source code, you must run your built image with the **DEV_MODE=true** environment variable.

    You can set new environment variables when , or updating environment variables for existing objects.

    Entering into a running container changes your current directory to /opt/app-root/src, where the source code is located.