@getmonoceros/workbench 1.6.9 → 1.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +31 -1
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2697,6 +2697,33 @@ async function detectDockerMode(options = {}) {
|
|
|
2697
2697
|
return "rootful";
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
+
function formatRootlessNotSupportedError() {
|
|
2701
|
+
return [
|
|
2702
|
+
`Monoceros requires Docker in "rootful" mode.`,
|
|
2703
|
+
``,
|
|
2704
|
+
`You're running Docker in "rootless" mode right now. That setup`,
|
|
2705
|
+
`runs the daemon without root privileges \u2014 sounds safer, but it`,
|
|
2706
|
+
`remaps user IDs between your host and the container in a way`,
|
|
2707
|
+
`that prevents the container from writing into the directories`,
|
|
2708
|
+
`Monoceros mounts into it. Cloning your repos, running`,
|
|
2709
|
+
`\`npm install\`, building \u2014 all fail with permission errors at`,
|
|
2710
|
+
`the first attempt.`,
|
|
2711
|
+
``,
|
|
2712
|
+
`To fix, switch back to standard rootful Docker:`,
|
|
2713
|
+
``,
|
|
2714
|
+
cyan2(` systemctl --user disable --now docker.service docker.socket`),
|
|
2715
|
+
cyan2(` dockerd-rootless-setuptool.sh uninstall`),
|
|
2716
|
+
cyan2(` rm -rf ~/.local/share/docker`),
|
|
2717
|
+
cyan2(` unset DOCKER_HOST`),
|
|
2718
|
+
cyan2(` sudo systemctl enable --now docker`),
|
|
2719
|
+
cyan2(` sudo usermod -aG docker $USER`),
|
|
2720
|
+
``,
|
|
2721
|
+
`Verify with ${cyan2("docker info | grep -i rootless")} \u2014 it should`,
|
|
2722
|
+
`produce no output. Then re-run.`,
|
|
2723
|
+
``,
|
|
2724
|
+
`Background: see ${cyan2("docs/docker-on-linux.md")} in the workbench repo.`
|
|
2725
|
+
].join("\n");
|
|
2726
|
+
}
|
|
2700
2727
|
|
|
2701
2728
|
// src/devcontainer/identity.ts
|
|
2702
2729
|
import { spawn as spawn6 } from "child_process";
|
|
@@ -2897,6 +2924,9 @@ ${sectionLine(label)}
|
|
|
2897
2924
|
const dockerMode = await detectDockerMode({
|
|
2898
2925
|
...opts.dockerInfoSpawn ? { spawn: opts.dockerInfoSpawn } : {}
|
|
2899
2926
|
});
|
|
2927
|
+
if (dockerMode === "rootless") {
|
|
2928
|
+
throw new Error(formatRootlessNotSupportedError());
|
|
2929
|
+
}
|
|
2900
2930
|
await fs8.mkdir(targetDir, { recursive: true });
|
|
2901
2931
|
await writeScaffold(createOpts, targetDir, { dockerMode });
|
|
2902
2932
|
await writeStateFile(
|
|
@@ -2974,7 +3004,7 @@ function warnOnDeprecatedFeatureRefs(containerFeatures, globalConfig, logger) {
|
|
|
2974
3004
|
}
|
|
2975
3005
|
|
|
2976
3006
|
// src/version.ts
|
|
2977
|
-
var CLI_VERSION = true ? "1.6.
|
|
3007
|
+
var CLI_VERSION = true ? "1.6.11" : "dev";
|
|
2978
3008
|
|
|
2979
3009
|
// src/commands/_dispatch.ts
|
|
2980
3010
|
import { consola as consola11 } from "consola";
|