#How do I add docker LABELS?

1 messages · Page 1 of 1 (latest)

karmic dune
#

How do I add a LABEL to a container when building the image via Go SDK? My company requires mandatory labels and I'd rather not create a Dockerfile.

buoyant jewel
#

That's not currently not possible, @karmic dune. I'm pretty sure it's something that we could implement, though. @vocal raft @gray yoke any thoughts on this? Or the more general problem of changing ImageConfig?

vocal raft
#

Hey -- not currently possible AFAIK, but fairly trivial to add. Would you mind filing an issue? /cc @severe panther

karmic dune
#

I don't mind! I will open one

vocal raft
#

Thank you!

minor wasp
karmic dune
cyan plinth
#

If someone can point me to a entry-point I am more than happy to implement this featre 🙂

minor wasp
# cyan plinth If someone can point me to a entry-point I am more than happy to implement this ...

👋 I guess the most difficult part is to come up with the API before starting to implement. Is adding something like withLabels to the Container type enough? there's also https://github.com/dagger/dagger/issues/4245 from @buoyant jewel which is relevant as well.

I think the initial step is to create an issue and suggest an API proposal to address this.

GitHub

This allows a user to add labels the Dockerfile build input Label { key: String! value: String! } type Directory { dockerBuild(dockerfile: String, platform: Platform, labels: [Label!]): Container! }

vocal raft
#

Commented on #4245 /cc @halcyon flame

mental idol
analog notch