Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17de78aed3 | |||
| eddb8cd156 |
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-02-06 - 1.12.0 - feat(docker)
|
||||||
|
add detailed logging for buildx, build commands, local registry, and local dependency info
|
||||||
|
|
||||||
|
- Log startup of local registry including a note about buildx dependency bridging
|
||||||
|
- Log constructed build commands and indicate whether buildx or standard docker build is used (including platforms and --push/--load distinctions)
|
||||||
|
- Emit build mode summary at start of build phase and report local base-image dependency mappings
|
||||||
|
- Report when --no-cache is enabled and surface buildx setup readiness with configured platforms
|
||||||
|
- Non-functional change: purely adds informational logging to improve observability during builds
|
||||||
|
|
||||||
## 2026-02-06 - 1.11.0 - feat(docker)
|
## 2026-02-06 - 1.11.0 - feat(docker)
|
||||||
start temporary local registry for buildx dependency resolution and ensure buildx builder uses host network
|
start temporary local registry for buildx dependency resolution and ensure buildx builder uses host network
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/tsdocker",
|
"name": "@git.zone/tsdocker",
|
||||||
"version": "1.11.0",
|
"version": "1.12.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "develop npm modules cross platform with docker",
|
"description": "develop npm modules cross platform with docker",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsdocker',
|
name: '@git.zone/tsdocker',
|
||||||
version: '1.11.0',
|
version: '1.12.0',
|
||||||
description: 'develop npm modules cross platform with docker'
|
description: 'develop npm modules cross platform with docker'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export class Dockerfile {
|
|||||||
}
|
}
|
||||||
// registry:2 starts near-instantly; brief wait for readiness
|
// registry:2 starts near-instantly; brief wait for readiness
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
logger.log('info', `Started local registry at ${LOCAL_REGISTRY_HOST}`);
|
logger.log('info', `Started local registry at ${LOCAL_REGISTRY_HOST} (buildx dependency bridge)`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Stops and removes the temporary local registry container. */
|
/** Stops and removes the temporary local registry container. */
|
||||||
@@ -492,6 +492,7 @@ export class Dockerfile {
|
|||||||
if (platformOverride) {
|
if (platformOverride) {
|
||||||
// Single platform override via buildx
|
// Single platform override via buildx
|
||||||
buildCommand = `docker buildx build --platform ${platformOverride}${noCacheFlag}${buildContextFlag} --load -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
|
buildCommand = `docker buildx build --platform ${platformOverride}${noCacheFlag}${buildContextFlag} --load -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
|
||||||
|
logger.log('info', `Build: buildx --platform ${platformOverride} --load`);
|
||||||
} else if (config.platforms && config.platforms.length > 1) {
|
} else if (config.platforms && config.platforms.length > 1) {
|
||||||
// Multi-platform build using buildx
|
// Multi-platform build using buildx
|
||||||
const platformString = config.platforms.join(',');
|
const platformString = config.platforms.join(',');
|
||||||
@@ -499,13 +500,16 @@ export class Dockerfile {
|
|||||||
|
|
||||||
if (config.push) {
|
if (config.push) {
|
||||||
buildCommand += ' --push';
|
buildCommand += ' --push';
|
||||||
|
logger.log('info', `Build: buildx --platform ${platformString} --push`);
|
||||||
} else {
|
} else {
|
||||||
buildCommand += ' --load';
|
buildCommand += ' --load';
|
||||||
|
logger.log('info', `Build: buildx --platform ${platformString} --load`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Standard build
|
// Standard build
|
||||||
const versionLabel = this.managerRef.projectInfo?.npm?.version || 'unknown';
|
const versionLabel = this.managerRef.projectInfo?.npm?.version || 'unknown';
|
||||||
buildCommand = `docker build --label="version=${versionLabel}"${noCacheFlag} -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
|
buildCommand = `docker build --label="version=${versionLabel}"${noCacheFlag} -t ${this.buildTag} -f ${this.filePath} ${buildArgsString} .`;
|
||||||
|
logger.log('info', 'Build: docker build (standard)');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
|
|||||||
@@ -132,12 +132,30 @@ export class TsDockerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if buildx is needed
|
// Check if buildx is needed
|
||||||
if (options?.platform || (this.config.platforms && this.config.platforms.length > 1)) {
|
const useBuildx = !!(options?.platform || (this.config.platforms && this.config.platforms.length > 1));
|
||||||
|
if (useBuildx) {
|
||||||
await this.ensureBuildx();
|
await this.ensureBuildx();
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('info', '');
|
logger.log('info', '');
|
||||||
logger.log('info', '=== BUILD PHASE ===');
|
logger.log('info', '=== BUILD PHASE ===');
|
||||||
|
|
||||||
|
if (useBuildx) {
|
||||||
|
const platforms = options?.platform || this.config.platforms!.join(', ');
|
||||||
|
logger.log('info', `Build mode: buildx multi-platform [${platforms}]`);
|
||||||
|
} else {
|
||||||
|
logger.log('info', 'Build mode: standard docker build');
|
||||||
|
}
|
||||||
|
|
||||||
|
const localDeps = toBuild.filter(df => df.localBaseImageDependent);
|
||||||
|
if (localDeps.length > 0) {
|
||||||
|
logger.log('info', `Local dependencies: ${localDeps.map(df => `${df.cleanTag} -> ${df.localBaseDockerfile?.cleanTag}`).join(', ')}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options?.noCache) {
|
||||||
|
logger.log('info', 'Cache: disabled (--no-cache)');
|
||||||
|
}
|
||||||
|
|
||||||
logger.log('info', `Building ${toBuild.length} Dockerfile(s)...`);
|
logger.log('info', `Building ${toBuild.length} Dockerfile(s)...`);
|
||||||
|
|
||||||
if (options?.cached) {
|
if (options?.cached) {
|
||||||
@@ -236,7 +254,8 @@ export class TsDockerManager {
|
|||||||
* Ensures Docker buildx is set up for multi-architecture builds
|
* Ensures Docker buildx is set up for multi-architecture builds
|
||||||
*/
|
*/
|
||||||
private async ensureBuildx(): Promise<void> {
|
private async ensureBuildx(): Promise<void> {
|
||||||
logger.log('info', 'Setting up Docker buildx for multi-platform builds...');
|
const platforms = this.config.platforms?.join(', ') || 'default';
|
||||||
|
logger.log('info', `Setting up Docker buildx for multi-platform builds [${platforms}]...`);
|
||||||
const inspectResult = await smartshellInstance.exec('docker buildx inspect tsdocker-builder 2>/dev/null');
|
const inspectResult = await smartshellInstance.exec('docker buildx inspect tsdocker-builder 2>/dev/null');
|
||||||
|
|
||||||
if (inspectResult.exitCode !== 0) {
|
if (inspectResult.exitCode !== 0) {
|
||||||
@@ -258,7 +277,7 @@ export class TsDockerManager {
|
|||||||
await smartshellInstance.exec('docker buildx use tsdocker-builder');
|
await smartshellInstance.exec('docker buildx use tsdocker-builder');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.log('ok', 'Docker buildx ready');
|
logger.log('ok', `Docker buildx ready (platforms: ${platforms})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user