Skip to content

Commit 6e09bc2

Browse files
authored
Merge pull request #672 from mook-as/docker-excise
Remove attempts to shim docker with nerdctl.
2 parents 63a8a9d + cd8f3a5 commit 6e09bc2

7 files changed

Lines changed: 7 additions & 27 deletions

File tree

background.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ async function doFirstRun() {
117117
linkResource('kim', true),
118118
linkResource('kubectl', true),
119119
linkResource('nerdctl', true),
120-
linkResource('docker', true),
121120
]);
122121
}
123122
}

scripts/download/tools.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,6 @@ export default async function main(platform) {
135135
throw new Error(`Matched ${ kimSHA.length } hits, not exactly 1, for platform ${ kubePlatform } in [${ allKimSHAs }]`);
136136
}
137137
await download(kimURL, kimPath, { expectedChecksum: kimSHA[0].split(/\s+/, 1)[0] });
138-
139-
if (kubePlatform === 'darwin') {
140-
// On macos nerdctl is an existing resource, so we can connect our fabricated docker utility
141-
// to it during tool installation. On Windows this happens during the build process.
142-
const sourcePath = path.join(binDir, 'nerdctl');
143-
const destPath = path.join(binDir, 'docker');
144-
145-
await fs.promises.copyFile(sourcePath, destPath);
146-
}
147-
148138
// Download Trivy
149139
// Always run this in the VM, so download the *LINUX* version into binDir
150140
// and move it over to the wsl/lima partition at runtime.

scripts/lib/build-utils.mjs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,19 @@ export default {
228228
if (!['windows', 'linux'].includes(os)) {
229229
throw new Error(`Unexpected os of ${ os }`);
230230
}
231-
let platDir, basename, parentDir, outFile, sourceFile, destFile;
231+
let platDir, parentDir, outFile;
232232

233233
if (os === 'windows') {
234234
platDir = 'win32';
235235
parentDir = path.join(this.srcDir, 'resources', platDir, 'bin');
236-
sourceFile = outFile = path.join(parentDir, 'nerdctl.exe');
237-
destFile = path.join(parentDir, 'docker.exe');
236+
outFile = path.join(parentDir, 'nerdctl.exe');
238237
} else {
239238
platDir = 'linux';
240239
parentDir = path.join(this.srcDir, 'resources', platDir, 'bin');
241-
// nerdctl-stub is the actual nerdctl binary to be run on linux
240+
// nerdctl-stub is the actual nerdctl binary to be run on linux;
241+
// there is also a `nerdctl` wrapper in the same directory to make it
242+
// easier to handle permissions for Linux-in-WSL.
242243
outFile = path.join(parentDir, 'nerdctl-stub');
243-
// nerdctl is a shell script wrapper to point to the above nerdctl binary,
244-
// hiding mount permissions from the linux/wsl-side user
245-
sourceFile = path.join(parentDir, 'nerdctl');
246-
destFile = path.join(parentDir, 'docker');
247244
}
248245
// The linux build produces both nerdctl-stub and nerdctl
249246
await this.spawn('go', 'build', '-ldflags', '-s -w', '-o', outFile, '.', {
@@ -253,7 +250,6 @@ export default {
253250
GOOS: os,
254251
}
255252
});
256-
await fs.promises.copyFile(sourceFile, destFile);
257253
},
258254

259255
/**

src/k8s-engine/unixlikeIntegrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import resources from '@/resources';
77
import PathConflictManager from '@/main/pathConflictManager';
88
import * as window from '@/window';
99

10-
const INTEGRATIONS = ['docker', 'helm', 'kim', 'kubectl', 'nerdctl'];
10+
const INTEGRATIONS = ['helm', 'kim', 'kubectl', 'nerdctl'];
1111
const console = new Console(Logging.background.stream);
1212
const PUBLIC_LINK_DIR = '/usr/local/bin';
1313

src/main/pathConflictManager.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ export default class PathConflictManager {
4646
console.log(`Error gathering conflicts for file ${ binaryName }`, err);
4747
// And leave results as an empty array, to clear the current warnings
4848
}
49-
if (binaryName === 'docker') {
50-
results.push("Links to rancher-desktop's nerdctl");
51-
}
5249
window.send('k8s-integration-warnings', binaryName, results);
5350
}
5451

src/resources.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { app } from 'electron';
44
import memoize from 'lodash/memoize';
55

66
const adjustNameWithDir: Record<string, string> = {
7-
docker: path.join('bin', 'docker'),
87
helm: path.join('bin', 'helm'),
98
kim: path.join('bin', 'kim'),
109
kubectl: path.join('bin', 'kubectl'),

src/utils/pathConflict.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ const regexes: Record<string, RegExp> = {
2222
export default async function pathConflict(targetDir: string, binaryName: string): Promise<Array<string>> {
2323
const referencePath = resources.executable(binaryName);
2424
// We don't ship nerdctl, just an unversioned stub; so hard-wire a truthy value.
25-
// And our docker is a symlink to nerdctl
26-
const isUnversioned = ['docker', 'nerdctl'].includes(binaryName);
25+
const isUnversioned = ['nerdctl'].includes(binaryName);
2726

2827
try {
2928
await fs.promises.access(referencePath, fs.constants.R_OK | fs.constants.X_OK);

0 commit comments

Comments
 (0)