docker(install): add tooldir to path for linux and windows

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2024-06-10 12:42:09 +02:00
parent 6a4479ebc2
commit 1309d2023e
3 changed files with 24 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals
import {Install} from '../../src/docker/install';
import {Docker} from '../../src/docker/docker';
import {Exec} from '../../src/exec';
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
@@ -40,6 +41,17 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
// prettier-ignore
test.each(['v24.0.4'])(
'install docker %s', async (version) => {
if (process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) {
// Remove containerd first on ubuntu runners to make sure it takes
// ones packaged with docker
await Exec.exec('sudo', ['apt-get', 'remove', '-y', 'containerd.io'], {
env: Object.assign({}, process.env, {
DEBIAN_FRONTEND: 'noninteractive'
}) as {
[key: string]: string;
}
});
}
await expect((async () => {
const install = new Install({
version: version,