@cloudflare/containers-shared 0.27.1 → 0.28.0
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/index.mjs +4 -3
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -3173,6 +3173,7 @@ async function constructBuildCommand(options) {
|
|
|
3173
3173
|
dockerfile
|
|
3174
3174
|
};
|
|
3175
3175
|
}
|
|
3176
|
+
const SUPPORTED_PLATFORMS = ["linux/amd64", "linux/arm64"];
|
|
3176
3177
|
/**
|
|
3177
3178
|
* Builds a container image from the given container options.
|
|
3178
3179
|
*
|
|
@@ -3339,7 +3340,7 @@ async function pushImageIfChanged({ pathToDocker, sourceTag, targetTag, containe
|
|
|
3339
3340
|
*/
|
|
3340
3341
|
async function buildCommand(args, complianceConfig) {
|
|
3341
3342
|
if (existsSync(args.PATH) && !isDirectory(args.PATH)) throw new UserError(`${args.PATH} is not a directory. Please specify a valid directory path.`, { telemetryMessage: "container build invalid path" });
|
|
3342
|
-
if (args.platform !== void 0 && args.platform
|
|
3343
|
+
if (args.platform !== void 0 && !SUPPORTED_PLATFORMS.includes(args.platform)) throw new UserError(`Unsupported platform: Platform "${args.platform}" is unsupported. Please use "linux/amd64" or "linux/arm64" instead.`, { telemetryMessage: "container build unsupported platform" });
|
|
3343
3344
|
const pathToDockerfile = join(args.PATH, "Dockerfile");
|
|
3344
3345
|
const pathToDocker = args.pathToDocker ?? getDockerPath();
|
|
3345
3346
|
try {
|
|
@@ -3384,12 +3385,12 @@ async function pushCommand(args, accountId, complianceConfig) {
|
|
|
3384
3385
|
throw new UserError("An unknown error occurred", { telemetryMessage: "container push unknown error" });
|
|
3385
3386
|
}
|
|
3386
3387
|
}
|
|
3387
|
-
async function checkImagePlatform(pathToDocker, imageTag
|
|
3388
|
+
async function checkImagePlatform(pathToDocker, imageTag) {
|
|
3388
3389
|
const platform = await dockerImageInspect(pathToDocker, {
|
|
3389
3390
|
imageTag,
|
|
3390
3391
|
formatString: "{{ .Os }}/{{ .Architecture }}"
|
|
3391
3392
|
});
|
|
3392
|
-
if (platform
|
|
3393
|
+
if (!SUPPORTED_PLATFORMS.includes(platform)) throw new Error(`Unsupported platform: Image platform (${platform}) is not linux/amd64 or linux/arm64`);
|
|
3393
3394
|
}
|
|
3394
3395
|
/**
|
|
3395
3396
|
* Builds a Docker image and optionally pushes it to the Cloudflare managed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/containers-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Internal-only shared container helpers for workers-sdk. Do not use directly; APIs are unstable and may change or disappear without notice.",
|
|
5
5
|
"homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/containers-shared#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cloudflare/build-output-utils": "1.0.0-rc.
|
|
28
|
-
"@cloudflare/
|
|
29
|
-
"@cloudflare/
|
|
30
|
-
"@cloudflare/workers-utils": "0.
|
|
27
|
+
"@cloudflare/build-output-utils": "1.0.0-rc.5",
|
|
28
|
+
"@cloudflare/config": "1.0.0-rc.5",
|
|
29
|
+
"@cloudflare/cli-shared-helpers": "0.3.14",
|
|
30
|
+
"@cloudflare/workers-utils": "0.58.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "22.15.17",
|