- Removed Dockerfile and added multiple Dockerfiles for various tools (ClickHouse, MongoDB, MinIO, Caddy, Redis) with Deno runtime. - Updated package.json to reflect new repository structure and versioning. - Added comprehensive README and technical notes for architecture overview and usage. - Implemented build and test scripts for streamlined image creation and validation. - Introduced bash scripts for NVM functionality in Docker images.
1.6 KiB
1.6 KiB
Image Support Files
This directory contains helper scripts that enable NVM (Node Version Manager) functionality in Docker images.
Files
bash-with-nvm
A wrapper script used as the SHELL directive in Dockerfiles. It loads NVM before executing any RUN command, enabling commands like:
SHELL ["/usr/local/bin/bash-with-nvm"]
RUN nvm install 18
RUN node --version
docker-entrypoint.sh
An entrypoint script that ensures NVM is available at runtime. It handles:
- Loading NVM environment on container start
- Special handling for
bash -ccommands (common in CI/CD) to inject bashrc sourcing
Usage
These files are copied into Alpine-based Docker images:
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
COPY image_support_files/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/bash-with-nvm /usr/local/bin/docker-entrypoint.sh
SHELL ["/usr/local/bin/bash-with-nvm"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
Why These Scripts Are Needed
NVM is a bash function, not a binary. This creates challenges in Docker:
- Build time: Each RUN command starts a fresh shell without NVM loaded
- Runtime: Container commands don't automatically have NVM available
- CI/CD: Non-interactive shells (bash -c) need special handling
These scripts solve all three contexts.
Maintenance
When updating NVM version, ensure compatibility with both scripts. The NVM_DIR path (/usr/local/nvm) must match across:
- These scripts
- Dockerfile ENV declarations
- /etc/bash.bashrc configuration