You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/containers-shared/src/images.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
import{buildImage}from"./build";
2
+
import{UserError}from"./error";
2
3
import{
3
4
getCloudflareContainerRegistry,
4
5
isCloudflareRegistryLink,
@@ -73,7 +74,7 @@ export async function prepareContainerImagesForDev(args: {
73
74
}=args;
74
75
letaborted=false;
75
76
if(process.platform==="win32"){
76
-
thrownewError(
77
+
thrownewUserError(
77
78
"Local development with containers is currently not supported on Windows. You should use WSL instead. You can also set `enable_containers` to false if you do not need to develop the container part of your application."
78
79
);
79
80
}
@@ -95,7 +96,7 @@ export async function prepareContainerImagesForDev(args: {
95
96
});
96
97
}else{
97
98
if(!isCloudflareRegistryLink(options.image_uri)){
98
-
thrownewError(
99
+
thrownewUserError(
99
100
`Image "${options.image_uri}" is a registry link but does not point to the Cloudflare container registry.\n`+
100
101
`To use an existing image from another repository, see https://developers.cloudflare.com/containers/image-management/#using-existing-images`
// We assume this command is unlikely to fail for reasons other than the Docker daemon not running, or the Docker CLI not being installed or in the PATH.
84
-
thrownewError(
85
+
thrownewUserError(
85
86
`The Docker CLI could not be launched. Please ensure that the Docker CLI is installed and the daemon is running.\n`+
86
87
`Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so. You can specify an executable with the environment variable WRANGLER_DOCKER_BIN and a socket with DOCKER_HOST.`+
87
88
`${isDev ? "\nTo suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your Wrangler config or passing in --enable-containers=false." : ""}`
@@ -103,7 +104,7 @@ export const isDockerfile = (
103
104
constmaybeDockerfile=path.resolve(baseDir,image);
104
105
if(existsSync(maybeDockerfile)){
105
106
if(isDir(maybeDockerfile)){
106
-
thrownewError(
107
+
thrownewUserError(
107
108
`${image} is a directory, you should specify a path to the Dockerfile`
0 commit comments