feat(dockerfiles): Add base Dockerfiles for dbase/dind, enable pnpm and stack-fix, update preinstalled image tooling and registries, and bump @git.zone/tsdocker devDependency
This commit is contained in:
61
Dockerfile_dbase_dind
Normal file
61
Dockerfile_dbase_dind
Normal file
@@ -0,0 +1,61 @@
|
||||
FROM docker:dind
|
||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Important environment variables
|
||||
ENV NODE_VERSION_LTS="24.13.0" \
|
||||
NVM_DIR="/usr/local/nvm" \
|
||||
PNPM_HOME="/root/.local/share/pnpm" \
|
||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||
|
||||
# System packages
|
||||
RUN apk add --no-cache \
|
||||
bash curl git openssl ca-certificates wget unzip \
|
||||
build-base python3 python3-dev py3-pip linux-headers \
|
||||
libgcc libstdc++ libc6-compat gnupg \
|
||||
libffi-dev openssl-dev libc-dev \
|
||||
iputils bind-tools \
|
||||
tini
|
||||
|
||||
# Install NVM
|
||||
RUN mkdir -p $NVM_DIR && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||
|
||||
# Make nvm available globally in all bash shells
|
||||
RUN printf '%s\n%s\n%s\n' \
|
||||
'export NVM_DIR="/usr/local/nvm"' \
|
||||
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' \
|
||||
'[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' \
|
||||
> /etc/bash.bashrc
|
||||
|
||||
# Copy nvm wrapper for build-time SHELL
|
||||
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
|
||||
RUN chmod +x /usr/local/bin/bash-with-nvm
|
||||
|
||||
# Use wrapper for RUN commands to enable nvm
|
||||
SHELL ["/usr/local/bin/bash-with-nvm"]
|
||||
|
||||
# Enable nvm for runtime bash commands (docker exec shells)
|
||||
ENV BASH_ENV=/etc/bash.bashrc
|
||||
|
||||
# Prepare pnpm directory
|
||||
RUN mkdir -p ${PNPM_HOME}
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
# Install Node.js LTS via NVM and pnpm
|
||||
# TARGETARCH fix: override nvm_get_arch for correct musl arch on arm64
|
||||
ARG TARGETARCH
|
||||
RUN NVM_MUSL_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-musl" || echo "x64-musl") \
|
||||
&& nvm_get_arch() { echo "$NVM_MUSL_ARCH"; } \
|
||||
&& nvm install $NODE_VERSION_LTS \
|
||||
&& nvm alias default $NODE_VERSION_LTS \
|
||||
&& nvm use default \
|
||||
&& npm install -g pnpm \
|
||||
&& pnpm -v \
|
||||
&& pnpm config set unsafe-perm true
|
||||
|
||||
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/lib/node_modules
|
||||
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||
|
||||
# Keep docker:dind's own ENTRYPOINT (dockerd-entrypoint.sh)
|
||||
# NVM is available in exec shells via BASH_ENV
|
||||
Reference in New Issue
Block a user