#Exposing Ports
1 messages · Page 1 of 1 (latest)
Hi @river yacht, currently dagger does not support long-running containers (aka "services"). It's planned though, we had an early support in the cue sdk but this needs to be ported to the new API. Once done, a service will be able to expose a port.
If you describe your use case here, maybe we can find a workaround.
@hidden pewter my use case is very simple, i'm just trying to replicate the behaviour that we have with EXPOSE instruction in a Dockerfile, basically, when building my container images using dagger i want to have the resulting image such that the container runtime expose x ports.
@river yacht EXPOSE in Dockerfiles is mostly for documentation purposes, it doesn't actually have any effects when the container is started since you still need to send the -p flag regardless. Having said that, you might want to follow this discussion as well https://discord.com/channels/707636530424053791/1042501877906022481 since that's related. cc @proper dirge
What are you trying to do? Allow to set OCI image config through cloak. Some other users in Discord are requesting this also. https://discord.com/channels/707636530424053791/1042489428788138025 htt...
Thanks @digital basin
Thanks, that was useful for my usecase too.
I think you can either :
-
just skip expose, since tools en generally don’t use it nowadays.
-
try a hack like this:
justExpose := c.Container().Build(c.Directory().WithNewFile("Dockerfile", "FROM scratch\nEXPOSE 8080"))
ctr := justExpose.<the rest of your build here>
Thanks @heavy grotto