Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5743898ba7 | |||
| c3847a970e | |||
| 2a7eb157b6 | |||
| 74c7bcd053 | |||
| e61aeaad2d | |||
| e1ad8c2d83 | |||
| 9aed8b7b40 | |||
| 165712267c | |||
| 391b13bf57 |
@@ -1,4 +1,4 @@
|
|||||||
name: Docker (tags)
|
name: Docker (non-tag pushes)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
@@ -82,15 +82,22 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @git.zone/tsdocker@latest
|
||||||
|
|
||||||
- name: Release
|
- name: Login to registries
|
||||||
run: |
|
run: tsdocker login
|
||||||
npmci docker login
|
|
||||||
npmci docker build
|
- name: List discovered Dockerfiles
|
||||||
npmci docker test
|
run: tsdocker list
|
||||||
# npmci docker push gitea.lossless.digital
|
|
||||||
npmci docker push code.foss.global
|
- name: Build all images
|
||||||
|
run: tsdocker build
|
||||||
|
|
||||||
|
- name: Test images
|
||||||
|
run: tsdocker test
|
||||||
|
|
||||||
|
- name: Push to code.foss.global
|
||||||
|
run: tsdocker push code.foss.global
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
needs: test
|
needs: test
|
||||||
|
|||||||
37
Dockerfile
37
Dockerfile
@@ -1,9 +1,13 @@
|
|||||||
FROM ubuntu:20.04
|
FROM ubuntu:24.04
|
||||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
# important environment variables
|
# important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.12.2" NODE_VERSION_STABLE="20.12.2" NVM_DIR="/usr/local/nvm"
|
ENV NODE_VERSION_LTS="24.13.0" NODE_VERSION_STABLE="24.13.0" NVM_DIR="/usr/local/nvm"
|
||||||
|
|
||||||
|
# Chromium paths for Puppeteer/Playwright compatibility
|
||||||
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||||
|
ENV CHROME_BIN=/usr/bin/chromium-browser
|
||||||
|
|
||||||
# Set debconf to run non-interactively and install packages
|
# Set debconf to run non-interactively and install packages
|
||||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
||||||
@@ -22,24 +26,23 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
|
|||||||
git \
|
git \
|
||||||
make \
|
make \
|
||||||
openssl \
|
openssl \
|
||||||
python \
|
|
||||||
python3 \
|
python3 \
|
||||||
rsync \
|
rsync \
|
||||||
ssh \
|
ssh \
|
||||||
wget \
|
wget \
|
||||||
unzip \
|
unzip \
|
||||||
# puppeteer
|
# puppeteer
|
||||||
gconf-service \
|
libasound2t64 \
|
||||||
libasound2 \
|
|
||||||
libatk1.0-0 \
|
libatk1.0-0 \
|
||||||
|
libatk-bridge2.0-0 \
|
||||||
libc6 \
|
libc6 \
|
||||||
libcairo2 \
|
libcairo2 \
|
||||||
libcups2 \
|
libcups2 \
|
||||||
libdbus-1-3 \
|
libdbus-1-3 \
|
||||||
libexpat1 \
|
libexpat1 \
|
||||||
libfontconfig1 \
|
libfontconfig1 \
|
||||||
libgcc1 \
|
libgbm1 \
|
||||||
libgconf-2-4 \
|
libgcc-s1 \
|
||||||
libgdk-pixbuf2.0-0 \
|
libgdk-pixbuf2.0-0 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
libgtk-3-0 \
|
libgtk-3-0 \
|
||||||
@@ -62,7 +65,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
|
|||||||
libxtst6 \
|
libxtst6 \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
fonts-liberation \
|
fonts-liberation \
|
||||||
libappindicator1 \
|
libayatana-appindicator3-1 \
|
||||||
libnss3 \
|
libnss3 \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
xdg-utils \
|
xdg-utils \
|
||||||
@@ -70,21 +73,21 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
|
|||||||
iputils-ping \
|
iputils-ping \
|
||||||
dnsutils \
|
dnsutils \
|
||||||
|
|
||||||
# chrome
|
# chromium (multi-arch compatible - works on both amd64 and arm64)
|
||||||
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
&& apt-get install -y -q --no-install-recommends chromium-browser \
|
||||||
&& apt install -y -q --no-install-recommends ./google-chrome-stable_current_amd64.deb \
|
|
||||||
|
|
||||||
# mongodb
|
# mongodb 8.0
|
||||||
&& curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - \
|
&& curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
|
||||||
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
|
gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg \
|
||||||
|
&& echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | \
|
||||||
|
tee /etc/apt/sources.list.d/mongodb-org-8.0.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y -q --no-install-recommends \
|
&& apt-get install -y -q --no-install-recommends mongodb-org \
|
||||||
mongodb-org \
|
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install nvm with node and npm
|
# Install nvm with node and npm
|
||||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
RUN mkdir -p $NVM_DIR && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||||
|
|
||||||
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
||||||
# IMPORTANT: Prepend to bashrc, before the "[ -z "$PS1" ] && return" line
|
# IMPORTANT: Prepend to bashrc, before the "[ -z "$PS1" ] && return" line
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# Important environment variables
|
# Important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
NVM_DIR="/usr/local/nvm" \
|
NVM_DIR="/usr/local/nvm" \
|
||||||
BUN_INSTALL="/root/.bun" \
|
BUN_INSTALL="/root/.bun" \
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
@@ -4,7 +4,7 @@ LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# Important environment variables
|
# Important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
NVM_DIR="/usr/local/nvm" \
|
NVM_DIR="/usr/local/nvm" \
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# Important environment variables
|
# Important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
NVM_DIR="/usr/local/nvm" \
|
NVM_DIR="/usr/local/nvm" \
|
||||||
PNPM_HOME="/root/.local/share/pnpm" \
|
PNPM_HOME="/root/.local/share/pnpm" \
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM host.today/ht-docker-node:alpine
|
FROM host.today/ht-docker-node:alpine-node
|
||||||
RUN apk update && apk add bash libc6-compat alpine-sdk
|
RUN apk update && apk add bash libc6-compat alpine-sdk
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
||||||
@@ -9,5 +9,4 @@ RUN npm install -g \
|
|||||||
@push.rocks/tapbundle \
|
@push.rocks/tapbundle \
|
||||||
axios \
|
axios \
|
||||||
@push.rocks/smartdelay \
|
@push.rocks/smartdelay \
|
||||||
@push.rocks/smartjson \
|
@push.rocks/smartjson
|
||||||
@push.rocks/tapbundle
|
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Lossless GmbH
|
Copyright (c) 2016 Task Venture Capital GmbH
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "🏔️ Building Multi-Architecture Alpine Docker Images"
|
|
||||||
echo "===================================================="
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Color codes
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
# Check if buildx is available
|
|
||||||
if ! docker buildx version &> /dev/null; then
|
|
||||||
echo -e "${YELLOW}⚠️ docker buildx not found. Installing...${NC}"
|
|
||||||
docker buildx create --use
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure buildx builder is running
|
|
||||||
echo -e "${BLUE}🔧 Setting up buildx builder...${NC}"
|
|
||||||
if ! docker buildx inspect default-builder &> /dev/null; then
|
|
||||||
docker buildx create --name default-builder --use
|
|
||||||
else
|
|
||||||
docker buildx use default-builder
|
|
||||||
fi
|
|
||||||
echo -e "${GREEN}✅ Buildx ready${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Build function for multi-arch
|
|
||||||
build_multiarch_image() {
|
|
||||||
local dockerfile=$1
|
|
||||||
local tag=$2
|
|
||||||
local description=$3
|
|
||||||
|
|
||||||
echo -e "${BLUE}📦 Building Multi-Arch: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Dockerfile: ${NC}${dockerfile}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
echo -e "${YELLOW} Platforms: ${NC}linux/amd64, linux/arm64"
|
|
||||||
|
|
||||||
if docker buildx build \
|
|
||||||
--platform linux/amd64,linux/arm64 \
|
|
||||||
-f "${dockerfile}" \
|
|
||||||
-t "${tag}" \
|
|
||||||
--load \
|
|
||||||
.; then
|
|
||||||
echo -e "${GREEN}✅ Success: ${NC}${tag} (amd64 + arm64)"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m❌ Failed: ${NC}${tag}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 Note: Multi-arch builds with --load only work for single platform.${NC}"
|
|
||||||
echo -e "${YELLOW} To test locally, build for your native platform:${NC}"
|
|
||||||
echo -e "${YELLOW} docker buildx build --platform linux/amd64 -f ${dockerfile} -t ${tag} --load .${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Build function for single platform (for local testing)
|
|
||||||
build_native_image() {
|
|
||||||
local dockerfile=$1
|
|
||||||
local tag=$2
|
|
||||||
local description=$3
|
|
||||||
local platform=$(uname -m)
|
|
||||||
|
|
||||||
# Convert platform name
|
|
||||||
if [ "$platform" = "x86_64" ]; then
|
|
||||||
platform="linux/amd64"
|
|
||||||
elif [ "$platform" = "aarch64" ] || [ "$platform" = "arm64" ]; then
|
|
||||||
platform="linux/arm64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "${BLUE}📦 Building Native: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Dockerfile: ${NC}${dockerfile}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
echo -e "${YELLOW} Platform: ${NC}${platform} (native)"
|
|
||||||
|
|
||||||
if docker buildx build \
|
|
||||||
--platform "${platform}" \
|
|
||||||
-f "${dockerfile}" \
|
|
||||||
-t "${tag}" \
|
|
||||||
--load \
|
|
||||||
.; then
|
|
||||||
echo -e "${GREEN}✅ Success: ${NC}${tag} (${platform})"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m❌ Failed: ${NC}${tag}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Building Alpine Images${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 Building for native platform only (for local testing)${NC}"
|
|
||||||
echo -e "${YELLOW} To build multi-arch for push to registry, use:${NC}"
|
|
||||||
echo -e "${YELLOW} docker buildx build --platform linux/amd64,linux/arm64 --push ...${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Build images for native platform (can be loaded for local testing)
|
|
||||||
build_native_image "Dockerfile_alpine_node" \
|
|
||||||
"ht-docker-node:alpine-node" \
|
|
||||||
"Alpine with Node.js LTS + NVM + pnpm"
|
|
||||||
|
|
||||||
build_native_image "Dockerfile_alpine_deno" \
|
|
||||||
"ht-docker-node:alpine-deno" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Deno"
|
|
||||||
|
|
||||||
build_native_image "Dockerfile_alpine_bun" \
|
|
||||||
"ht-docker-node:alpine-bun" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Bun"
|
|
||||||
|
|
||||||
# Summary
|
|
||||||
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${GREEN}✨ All Alpine Images Built Successfully!${NC}"
|
|
||||||
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo "📋 Built Images (Native Platform):"
|
|
||||||
echo ""
|
|
||||||
docker images | grep "ht-docker-node:alpine" | awk '{printf " ✅ %-30s %10s\n", $1":"$2, $7" "$8}'
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 These images are built for your native architecture for local testing.${NC}"
|
|
||||||
echo -e "${YELLOW} In CI/CD, build with: docker buildx build --platform linux/amd64,linux/arm64 --push${NC}"
|
|
||||||
echo ""
|
|
||||||
16
changelog.md
16
changelog.md
@@ -1,5 +1,21 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-02-06 - 5.3.0 - feat(docker)
|
||||||
|
add Chromium support for Puppeteer/Playwright and npm build/release scripts
|
||||||
|
|
||||||
|
- Add PUPPETEER_EXECUTABLE_PATH and CHROME_BIN env vars pointing to /usr/bin/chromium-browser for Puppeteer/Playwright compatibility
|
||||||
|
- Replace Google Chrome .deb download with apt-get install chromium-browser for multi-arch (amd64/arm64) compatibility
|
||||||
|
- Add npm scripts: 'build' -> 'tsdocker build' and 'release' -> 'tsdocker push' in package.json
|
||||||
|
|
||||||
|
## 2026-02-06 - 5.2.0 - feat(ci)
|
||||||
|
switch CI to use @git.zone/tsdocker and add tsdocker config and image tests
|
||||||
|
|
||||||
|
- Replace @ship.zone/npmci with @git.zone/tsdocker in CI workflow and use tsdocker commands: login, list, build, test, push
|
||||||
|
- Add npmextra.json configuration for @git.zone/tsdocker (registries, registryRepoMap, platforms, push/testDir)
|
||||||
|
- Add Dockerfile_alpine-npmci and per-image test scripts under test/ (alpine-bun, alpine-deno, alpine-node)
|
||||||
|
- Remove legacy Alpine Dockerfiles and legacy build/test scripts (Dockerfile_alpine_node/deno/bun/_npmci, build-alpine-images.sh, test-alpine-images.sh)
|
||||||
|
- Update LICENSE copyright owner to Task Venture Capital GmbH
|
||||||
|
|
||||||
## 2025-10-26 - 5.1.0 - feat(alpine-deno)
|
## 2025-10-26 - 5.1.0 - feat(alpine-deno)
|
||||||
Improve alpine deno image: switch to alpine:edge and use native Deno package, remove glibc workaround, update NVM/PATH, add local tooling settings and expanded README
|
Improve alpine deno image: switch to alpine:edge and use native Deno package, remove glibc workaround, update NVM/PATH, add local tooling settings and expanded README
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,21 @@
|
|||||||
"registry.gitlab.com"
|
"registry.gitlab.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"@git.zone/tsdocker": {
|
||||||
|
"registries": [
|
||||||
|
"code.foss.global",
|
||||||
|
"registry.gitlab.com",
|
||||||
|
"docker.io"
|
||||||
|
],
|
||||||
|
"registryRepoMap": {
|
||||||
|
"code.foss.global": "host.today/ht-docker-node",
|
||||||
|
"registry.gitlab.com": "hosttoday/ht-docker-node",
|
||||||
|
"docker.io": "hosttoday/ht-docker-node"
|
||||||
|
},
|
||||||
|
"platforms": ["linux/amd64", "linux/arm64"],
|
||||||
|
"push": false,
|
||||||
|
"testDir": "./test"
|
||||||
|
},
|
||||||
"tsdoc": {
|
"tsdoc": {
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
}
|
}
|
||||||
|
|||||||
18
package.json
18
package.json
@@ -1,34 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "ht-docker-node",
|
"name": "ht-docker-node",
|
||||||
"version": "5.1.0",
|
"version": "5.3.0",
|
||||||
"description": "A Docker image that integrates Node.js with shipzone.io support.",
|
"description": "A Docker image that integrates Node.js with shipzone.io support.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no npm test specified\"",
|
"test": "echo \"no npm test specified\"",
|
||||||
"build": "echo \"Not needed for now\""
|
"build": "tsdocker build",
|
||||||
|
"release": "tsdocker push"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/HostToday/ht-docker-node.git"
|
"url": "git+https://github.com/HostToday/ht-docker-node.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Task Venture Capital GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/HostToday/ht-docker-node/issues"
|
"url": "https://github.com/HostToday/ht-docker-node/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/HostToday/ht-docker-node#readme",
|
"homepage": "https://github.com/HostToday/ht-docker-node#readme",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
|
||||||
"ts/*",
|
|
||||||
"ts_web/*",
|
|
||||||
"dist/*",
|
|
||||||
"dist_web/*",
|
|
||||||
"dist_ts_web/*",
|
|
||||||
"assets/*",
|
|
||||||
"cli.js",
|
|
||||||
"npmextra.json",
|
|
||||||
"readme.md"
|
|
||||||
],
|
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Technical Implementation Notes
|
# Technical Implementation Notes
|
||||||
|
|
||||||
## NVM Support (v5.0.147)
|
## NVM Support (v5.2.0)
|
||||||
|
|
||||||
### How NVM Works in This Image
|
### How NVM Works in This Image
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ The image provides full nvm support in three contexts:
|
|||||||
- Critical for CI/CD workflow support
|
- Critical for CI/CD workflow support
|
||||||
|
|
||||||
#### 4. ENV PATH Fallback
|
#### 4. ENV PATH Fallback
|
||||||
- Maintains `ENV PATH` pointing to default Node v20.12.2
|
- Maintains `ENV PATH` pointing to default Node v24.13.0
|
||||||
- Ensures non-bash shells (sh, dash) still have node access
|
- Ensures non-bash shells (sh, dash) still have node access
|
||||||
- Backward compatible with existing usage
|
- Backward compatible with existing usage
|
||||||
|
|
||||||
@@ -74,10 +74,23 @@ RUN node --version # Now shows v18.x.x
|
|||||||
|
|
||||||
### Maintenance Notes
|
### Maintenance Notes
|
||||||
|
|
||||||
**If updating nvm version**: Modify line 86 in Dockerfile
|
**If updating nvm version**: Modify line 87 in Dockerfile (currently NVM v0.40.1)
|
||||||
|
|
||||||
**If base image changes**: Verify /etc/bash.bashrc structure still has early return pattern
|
**If base image changes**: Verify /etc/bash.bashrc structure still has early return pattern
|
||||||
|
|
||||||
|
## Ubuntu 24.04 Upgrade Notes
|
||||||
|
|
||||||
|
- Base image upgraded from Ubuntu 20.04 to 24.04
|
||||||
|
- Python 2 removed (EOL since 2020), Python 3 retained
|
||||||
|
- Package changes for 24.04 compatibility:
|
||||||
|
- `gconf-service` and `libgconf-2-4` removed (deprecated GConf)
|
||||||
|
- `libgcc1` replaced with `libgcc-s1`
|
||||||
|
- `libappindicator1` replaced with `libayatana-appindicator3-1`
|
||||||
|
- `libasound2` replaced with `libasound2t64` (t64 transition)
|
||||||
|
- `libgbm1` and `libatk-bridge2.0-0` added for Chrome/Puppeteer
|
||||||
|
- MongoDB upgraded from 4.4 to 8.0 (uses modern gpg keyring approach instead of deprecated apt-key)
|
||||||
|
- Node.js upgraded to v24.13.0 LTS (Krypton, supported until April 2028)
|
||||||
|
|
||||||
**If ENTRYPOINT conflicts**: Users can override with `--entrypoint` flag:
|
**If ENTRYPOINT conflicts**: Users can override with `--entrypoint` flag:
|
||||||
```bash
|
```bash
|
||||||
docker run --entrypoint /bin/bash image -c "commands"
|
docker run --entrypoint /bin/bash image -c "commands"
|
||||||
|
|||||||
40
readme.md
40
readme.md
@@ -25,12 +25,10 @@ Perfect for complex builds requiring native dependencies and maximum compatibili
|
|||||||
|
|
||||||
| Tag | Description | Use Case |
|
| Tag | Description | Use Case |
|
||||||
|-----|-------------|----------|
|
|-----|-------------|----------|
|
||||||
| `:latest` / `:lts` | Node.js LTS with NVM | General purpose, production builds |
|
| `:latest` | Node.js LTS with NVM (Ubuntu 24.04) | General purpose, production builds |
|
||||||
| `:stable` | Node.js stable release | Latest stable features |
|
| `:lts` | Based on latest | Explicit LTS naming |
|
||||||
| `:npmci` | With npmci preinstalled | CI/CD pipelines |
|
| `:npmci` | With npmci preinstalled | CI/CD pipelines |
|
||||||
| `:npmts` | npmci + npmts | TypeScript projects |
|
| `:stableinit` | Stable initialization base | Init scripts |
|
||||||
| `:npmpage` | npmci + npmts + npmpage | Static site generation |
|
|
||||||
| `:mongo` | npmci + npmts + MongoDB | Full-stack development |
|
|
||||||
|
|
||||||
### Alpine-Based Images (Lightweight & Multi-Arch) ⚡
|
### Alpine-Based Images (Lightweight & Multi-Arch) ⚡
|
||||||
|
|
||||||
@@ -41,6 +39,7 @@ Perfect for complex builds requiring native dependencies and maximum compatibili
|
|||||||
| `:alpine-node` | Node.js LTS + NVM + pnpm | ~200MB | amd64, arm64 |
|
| `:alpine-node` | Node.js LTS + NVM + pnpm | ~200MB | amd64, arm64 |
|
||||||
| `:alpine-deno` | Node.js LTS + NVM + Deno | ~180MB | amd64, arm64 |
|
| `:alpine-deno` | Node.js LTS + NVM + Deno | ~180MB | amd64, arm64 |
|
||||||
| `:alpine-bun` | Node.js LTS + NVM + Bun | ~150MB | amd64, arm64 |
|
| `:alpine-bun` | Node.js LTS + NVM + Bun | ~150MB | amd64, arm64 |
|
||||||
|
| `:alpine-npmci` | Alpine Node + npmci + build tools | ~250MB | amd64, arm64 |
|
||||||
|
|
||||||
**✨ Multi-architecture magic:** Docker automatically selects the right image for your platform. Build on Mac, deploy on Linux servers—same Dockerfile, native speed everywhere.
|
**✨ Multi-architecture magic:** Docker automatically selects the right image for your platform. Build on Mac, deploy on Linux servers—same Dockerfile, native speed everywhere.
|
||||||
|
|
||||||
@@ -260,31 +259,34 @@ nvm use 18
|
|||||||
|
|
||||||
## 🏗️ Building Multi-Architecture Images
|
## 🏗️ Building Multi-Architecture Images
|
||||||
|
|
||||||
For teams building custom images:
|
This project uses [@git.zone/tsdocker](https://code.foss.global/git.zone/tsdocker) for Docker image management.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repo
|
# Install tsdocker
|
||||||
git clone https://github.com/HostToday/ht-docker-node.git
|
pnpm install -g @git.zone/tsdocker@latest
|
||||||
cd ht-docker-node
|
|
||||||
|
|
||||||
# Build Alpine images (native platform for local testing)
|
# List all discovered Dockerfiles and their tags
|
||||||
chmod +x build-alpine-images.sh
|
tsdocker list
|
||||||
./build-alpine-images.sh
|
|
||||||
|
|
||||||
# Test the built images
|
# Build all images (multi-arch: amd64 + arm64)
|
||||||
chmod +x test-alpine-images.sh
|
tsdocker build
|
||||||
./test-alpine-images.sh
|
|
||||||
|
# Test all images
|
||||||
|
tsdocker test
|
||||||
|
|
||||||
|
# Push to a specific registry
|
||||||
|
tsdocker push code.foss.global
|
||||||
```
|
```
|
||||||
|
|
||||||
### Production Multi-Arch Builds
|
### Manual Builds
|
||||||
|
|
||||||
For publishing to registries:
|
For building individual images manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build for both amd64 and arm64, push to registry
|
# Build for both amd64 and arm64, push to registry
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
-f Dockerfile_alpine_node \
|
-f Dockerfile_alpine-node \
|
||||||
-t your-registry/your-image:alpine-node \
|
-t your-registry/your-image:alpine-node \
|
||||||
--push \
|
--push \
|
||||||
.
|
.
|
||||||
@@ -463,7 +465,7 @@ USER node
|
|||||||
|
|
||||||
| Feature | Ubuntu `:latest` | Alpine `:alpine-node` |
|
| Feature | Ubuntu `:latest` | Alpine `:alpine-node` |
|
||||||
|---------|------------------|----------------------|
|
|---------|------------------|----------------------|
|
||||||
| Base Size | ~800MB | ~200MB |
|
| Base Size | ~900MB | ~200MB |
|
||||||
| Build Tools | ✅ Full | ⚠️ Install separately |
|
| Build Tools | ✅ Full | ⚠️ Install separately |
|
||||||
| Compatibility | ✅ Maximum | ✅ Good (musl) |
|
| Compatibility | ✅ Maximum | ✅ Good (musl) |
|
||||||
| Multi-arch | ❌ amd64 only | ✅ amd64, arm64 |
|
| Multi-arch | ❌ amd64 only | ✅ amd64, arm64 |
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "🧪 Testing Multi-Architecture Alpine Docker Images"
|
|
||||||
echo "==================================================="
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Color codes
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
RED='\033[0;31m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
FAILED_TESTS=0
|
|
||||||
|
|
||||||
# Test function
|
|
||||||
test_image() {
|
|
||||||
local tag=$1
|
|
||||||
local description=$2
|
|
||||||
local test_cmd=$3
|
|
||||||
|
|
||||||
echo -e "${BLUE}🧪 Testing: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
|
|
||||||
if docker run --rm "${tag}" bash -c "${test_cmd}"; then
|
|
||||||
echo -e "${GREEN}✅ Pass${NC}"
|
|
||||||
echo ""
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo -e "${RED}❌ Fail${NC}"
|
|
||||||
echo ""
|
|
||||||
((FAILED_TESTS++))
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Test Alpine Images (Native Platform)
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Testing Alpine Images (Native Platform)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 These images are built for your native architecture${NC}"
|
|
||||||
echo -e "${YELLOW} They will run at full native speed without emulation${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-node" \
|
|
||||||
"Alpine with Node.js LTS + NVM + pnpm" \
|
|
||||||
"nvm --version && node --version && pnpm --version"
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-deno" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Deno" \
|
|
||||||
"nvm --version && node --version && deno --version"
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-bun" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Bun" \
|
|
||||||
"nvm --version && node --version && bun --version"
|
|
||||||
|
|
||||||
# Test NVM version switching (critical feature)
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Testing NVM Version Switching${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-node" \
|
|
||||||
"NVM version switching" \
|
|
||||||
"node --version && nvm install 18 && node --version | grep v18"
|
|
||||||
|
|
||||||
# Summary
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
if [ $FAILED_TESTS -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}✨ All Tests Passed! (0 failures)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 In production, these same images will work natively on both amd64 and arm64${NC}"
|
|
||||||
echo ""
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo -e "${RED}❌ Some Tests Failed (${FAILED_TESTS} failures)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
18
test/test_alpine-bun.sh
Executable file
18
test/test_alpine-bun.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-bun image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test Bun
|
||||||
|
echo "Testing Bun..."
|
||||||
|
bun --version
|
||||||
|
|
||||||
|
echo "alpine-bun tests passed!"
|
||||||
18
test/test_alpine-deno.sh
Executable file
18
test/test_alpine-deno.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-deno image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test Deno
|
||||||
|
echo "Testing Deno..."
|
||||||
|
deno --version
|
||||||
|
|
||||||
|
echo "alpine-deno tests passed!"
|
||||||
24
test/test_alpine-node.sh
Executable file
24
test/test_alpine-node.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-node image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test pnpm
|
||||||
|
echo "Testing pnpm..."
|
||||||
|
pnpm --version
|
||||||
|
|
||||||
|
# Test NVM version switching
|
||||||
|
echo "Testing NVM version switching..."
|
||||||
|
nvm install 18
|
||||||
|
nvm use 18
|
||||||
|
node --version | grep v18
|
||||||
|
|
||||||
|
echo "alpine-node tests passed!"
|
||||||
@@ -1 +1,32 @@
|
|||||||
echo "this runs within latest container!";
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing latest image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test pnpm
|
||||||
|
echo "Testing pnpm..."
|
||||||
|
pnpm --version
|
||||||
|
|
||||||
|
# Test Bun
|
||||||
|
echo "Testing Bun..."
|
||||||
|
bun --version
|
||||||
|
|
||||||
|
# Test Deno
|
||||||
|
echo "Testing Deno..."
|
||||||
|
deno --version
|
||||||
|
|
||||||
|
# Test NVM version switching
|
||||||
|
echo "Testing NVM version switching..."
|
||||||
|
nvm install 22
|
||||||
|
nvm use 22
|
||||||
|
node --version | grep v22
|
||||||
|
|
||||||
|
echo "latest tests passed!"
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# check if npmci is available
|
# check if npmci is available
|
||||||
npm init -y
|
npm init -y
|
||||||
npmci -v
|
npmci -v
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# npm
|
# npm
|
||||||
npm -v
|
npm -v
|
||||||
node -v
|
node -v
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"useDefineForClassFields": false,
|
|
||||||
"target": "ES2022",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"verbatimModuleSyntax": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"dist_*/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user