Skip to content

Commit ec6bd2e

Browse files
committed
Always check for Docker when using containers
Even in dry run mode we should check that Docker is installed, because dry run mode uses docker commands too.
1 parent 7c4ab68 commit ec6bd2e

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

packages/wrangler/src/deploy/deploy.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,23 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
770770
let workerBundle: FormData;
771771
const dockerPath = getDockerPath();
772772

773+
// lets fail earlier in the case where docker isn't installed
774+
// and we have containers so that we don't get into a
775+
// disjointed state where the worker updates but the container
776+
// fails.
777+
if (config.containers) {
778+
// if you have a registry url specified, you don't need docker
779+
const hasDockerfiles = config.containers.some((container) =>
780+
isDockerfile(
781+
container.image ?? container.configuration?.image,
782+
config.configPath
783+
)
784+
);
785+
if (hasDockerfiles) {
786+
await verifyDockerInstalled(dockerPath, false);
787+
}
788+
}
789+
773790
if (props.dryRun) {
774791
if (config.containers) {
775792
for (const container of config.containers) {
@@ -792,23 +809,6 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
792809
} else {
793810
assert(accountId, "Missing accountId");
794811

795-
// lets fail earlier in the case where docker isn't installed
796-
// and we have containers so that we don't get into a
797-
// disjointed state where the worker updates but the container
798-
// fails.
799-
if (config.containers) {
800-
// if you have a registry url specified, you don't need docker
801-
const hasDockerfiles = config.containers?.some((container) =>
802-
isDockerfile(
803-
container.image ?? container.configuration?.image,
804-
config.configPath
805-
)
806-
);
807-
if (hasDockerfiles) {
808-
await verifyDockerInstalled(dockerPath, false);
809-
}
810-
}
811-
812812
if (getFlag("RESOURCES_PROVISION")) {
813813
await provisionBindings(
814814
bindings,

0 commit comments

Comments
 (0)