#Unset entrypoint?
1 messages · Page 1 of 1 (latest)
there is a container.withoutEntrypoint
ah I didn’t see it in the docs for the NodeJS SDK; is this new?
I don’t think so - but maybe it didn’t get shipped? let me check
@tidal ether I don't recall having a WithoutEntrypoint. Having said that, setting the WithEntryPoint to something blank should work.
digest, err := client.Container().From("nginx").
WithEntrypoint([]string{"echo", "hello"}).
WithDefaultArgs(dagger.ContainerWithDefaultArgsOpts{Args: []string{""}}).
Publish(ctx, "ttl.sh/marcosnils:nginxtest")
^ that resets the entrypoint to "echo hello"
oh that’s what it was!
I don't think that's right... Should be WithEntrypoint(nil) no? WithDefaultArgs is something else
Yep, WithEntrypoint(nil) and WithDefaultArgs(). for entrypoint and default args. If either one of those is set, it'll run as a default command.
I agree with that issue, WithEntrypoint(nil) is very confusing
I just checked and WithEntrypoint(nil) doesn't do anything
I think technically it's WithEntrypoint([]string{})
The GraphQL spec doesn't allow a null args value
WithEntrypoint([]string{}) also doesn't change it
Yeah, but the Go SDK has turned nil into the empty []string{} via marshaling. So in Go it should be equivalent.
What's your repro?
digest, err := client.Container().From("nginx").
WithEntrypoint([]string{}).
Publish(ctx, "ttl.sh/marcosnils:nginxtest")
^ if you run that image afterwards, the nginx default entrypoint is kept
wait, I got it wrong
docker inspect --format='{{json .Config.Entrypoint}}' ttl.sh/marcosnils:nginxtest
[""]
yep, that's it. Thx Helder 🚀
Don't need the empty string. That's not empty args. It's a list with an empty value.
Oh, sorry I didn't check to see if the removed entrypoint is applied to a pushed image. Only tested with immediate execution
So WithEntrypoint([]string{}) rather than WithEntrypoint([]string{""}).
yep :😊
docker pull ttl.sh/marcosnils:solomontest@sha256:9f7396c3c2e63e423153df613c434cfa0212523d7049c8c55c2dc23576cdda62
Welcome to Dagger API Playground
Side note: add a ttl.sh module to zenith 😛
I keep doing tests so you might be getting inconsistent outputs 😬
but yes, both WithEntrypoint(nil) and WithEntrypoint([]string{}) will set the OCI spec to Entrypoint:null as Helder was correctly pointing out
@frozen harness let us know if this helps with your current issue and if you need further help 🙏
To reset the default args I believe all you need is WithDefaultArgs() since that argument is optional.
Welcome to Dagger API Playground
yep, indeed
ill give it a shot tomorrow
this worked:
.withEntrypoint([])
I'd expect to be able to pass null here (this is the Node SDK) to unset it; it makes sense when you think about it for a few minutes but it's a little counterintuitive when you are first encountering it.
Thanks for the help, I can reset it now.
@scarlet rune ^
@frozen harness thanks for the feedback, I agree. We should 1) support null and 2) add withoutEntrypoint IMO
that makes sense @frozen harness ! glad you managed to make it work. Would you mind opening an issue in dagger/dagger so we can address the nil case? We accept contributions too 😛
sure, maybe ill be able to help out there
sorry that took a while, just added the issue