feat(tsdocker): add multi-registry and multi-arch Docker build/push/pull manager, registry storage, Dockerfile handling, and new CLI commands

This commit is contained in:
2026-01-20 09:33:31 +00:00
parent e9a12f1c17
commit e1492f8ec4
14 changed files with 1211 additions and 53 deletions

View File

@@ -1,14 +1,12 @@
import * as plugins from './tsdocker.plugins.js';
import * as paths from './tsdocker.paths.js';
import * as fs from 'fs';
import type { ITsDockerConfig } from './interfaces/index.js';
export interface IConfig {
baseImage: string;
command: string;
dockerSock: boolean;
// Re-export ITsDockerConfig as IConfig for backward compatibility
export type IConfig = ITsDockerConfig & {
exitCode?: number;
keyValueObject: {[key: string]: any};
}
};
const getQenvKeyValueObject = async () => {
let qenvKeyValueObjectArray: { [key: string]: string | number };
@@ -23,11 +21,20 @@ const getQenvKeyValueObject = async () => {
const buildConfig = async (qenvKeyValueObjectArg: { [key: string]: string | number }) => {
const npmextra = new plugins.npmextra.Npmextra(paths.cwd);
const config = npmextra.dataFor<IConfig>('@git.zone/tsdocker', {
// Legacy options (backward compatible)
baseImage: 'hosttoday/ht-docker-node:npmdocker',
init: 'rm -rf node_nodules/ && yarn install',
command: 'npmci npm test',
dockerSock: false,
keyValueObject: qenvKeyValueObjectArg
keyValueObject: qenvKeyValueObjectArg,
// New Docker build options
registries: [],
registryRepoMap: {},
buildArgEnvMap: {},
platforms: ['linux/amd64'],
push: false,
testDir: undefined,
});
return config;
};