#ERROR: no command has been executed

1 messages · Page 1 of 1 (latest)

ivory stag
#

I'm feeling quite stupid at the moment, but I'm not finding the answer anywhere, and the error message doesn't seem terribly helpful to me.

I've got this code that I'm running using the Dagger Go SDK: https://gist.github.com/gmlewis/9fd12016fa750ac07e86452e659606c0

and the Dockerfile starts with: FROM node:16 as builder (I also tried "node:18").
This same method works great in a different repo (with a different Dockerfile), but fails in my current repo with the following error:

2023/03/10 18:29:17 PublishToAzure: Building container from "Dockerfile"

#6 resolve image config for docker.io/library/golang:1.20
#6 DONE 1.9s

#8 [internal] load metadata for docker.io/library/node:16
2023/03/10 18:29:18 PublishToAzure: Build FAILED: input:1: container.build.stdout no command has been executed

(Note that this Dockerfile builds fine locally on both Mac and Linux but this error is happening within a GitHub Action.)
Any ideas what I'm doing wrong?

versed python
#

If you want to run the default entrypoint in the Dockerfile, you can use prodImage.WithExec(nil).Stdout(ctx).

#

Before that error message was introduced .Stdout() would just return nil and not execute anything, which led to confusion.

ivory stag
#

Ah! Wow, thank you, @versed python ! TIL!!!

ivory stag
#

Any ideas why my "ENTRYPOINT" command is being executed during the Dagger "Build" of my container image?

#

Is WithExec(nil) attempting to RUN my Docker image? I only want to build it.

versed python
#

Ah, then don't use Stdout(). That assumes you want to run the container's command and get it's output.

ivory stag
#

Oh, but I need the WithExec(nil) to make sure the container is built?!? That seems really weird.

versed python
#

The publish will build it on it's own. No need to force build explicitly.

ivory stag
#

How do I get a dump of the actual build process? Will that happen during the "Publish" too? OK, so I can remove the WithExec(nil).Stdout() entirely then?

versed python
#

Yes, you can remove that.

ivory stag
#

Ah, wow. Thanks again, @versed python !

#

Is Publish() smart enough to build it only once if I publish to multiple ACRs in a loop (dev+qa)?

versed python
#

Yes it is. It's not Publish()'s responsibility, it's just the dagger engine figuring out dependencies and maximizing parallelism.