diff --git a/__tests__/docker/install.test.itg.ts b/__tests__/docker/install.test.itg.ts index f25a547..7313b67 100644 --- a/__tests__/docker/install.test.itg.ts +++ b/__tests__/docker/install.test.itg.ts @@ -29,7 +29,8 @@ describe('install', () => { jest.resetModules(); process.env = { ...originalEnv, - SIGN_QEMU_BINARY: '1' + SIGN_QEMU_BINARY: '1', + COLIMA_START_ARGS: '--cpu 4 --memory 8 --disk 32 --dns 1.1.1.1 --dns 8.8.8.8 --dns-host example.com=1.2.3.4' }; }); afterEach(() => { diff --git a/src/docker/assets.ts b/src/docker/assets.ts index 75f1ff5..dc8d923 100644 --- a/src/docker/assets.ts +++ b/src/docker/assets.ts @@ -272,7 +272,7 @@ provision: script: | mkdir -p /tmp/docker-bins cd /tmp/docker-bins - wget -qO- "https://download.docker.com/linux/static/{{dockerChannel}}/{{hostArch}}/docker-{{dockerVersion}}.tgz" | tar xvz --strip 1 + wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1 mv -f /tmp/docker-bins/* /usr/bin/ # Modify ~/.ssh/config automatically to include a SSH config for the virtual machine. diff --git a/src/docker/install.ts b/src/docker/install.ts index 03c0d3a..512b6d5 100644 --- a/src/docker/install.ts +++ b/src/docker/install.ts @@ -141,15 +141,15 @@ export class Install { } await core.group('Creating colima config', async () => { - let daemonConfig = yaml.dump({docker: {}}); + let colimaDaemonConfig = {}; if (this.daemonConfig) { - daemonConfig = yaml.dump(yaml.load(JSON.stringify({docker: JSON.parse(this.daemonConfig)}))); + colimaDaemonConfig = JSON.parse(this.daemonConfig); } const colimaCfg = handlebars.compile(colimaYamlData)({ - hostArch: Install.platformArch(), - dockerVersion: this._version, - dockerChannel: this.channel, - daemonConfig: daemonConfig + daemonConfig: yaml.dump(yaml.load(JSON.stringify({docker: colimaDaemonConfig}))), + dockerBinVersion: this._version, + dockerBinChannel: this.channel, + dockerBinArch: Install.platformArch() }); core.info(`Writing colima config to ${path.join(colimaDir, 'colima.yaml')}`); fs.writeFileSync(path.join(colimaDir, 'colima.yaml'), colimaCfg); @@ -180,8 +180,12 @@ export class Install { }; await core.group('Starting colima', async () => { + const colimaStartArgs = ['start', '--very-verbose']; + if (process.env.COLIMA_START_ARGS) { + colimaStartArgs.push(process.env.COLIMA_START_ARGS); + } try { - await Exec.exec('colima', ['start', '--very-verbose'], {env: envs}); + await Exec.exec(`colima ${colimaStartArgs.join(' ')}`, [], {env: envs}); } catch (e) { const haStderrLog = path.join(os.homedir(), '.lima', 'colima', 'ha.stderr.log'); if (fs.existsSync(haStderrLog)) {