Description
I would like to add an option to specify the network namespace akin to what docker cli --network does. In some cases, I would like to drop the container into host network namespace in order to access other resources running on the dev machine. For example, I run a testing consul through the docker compose stack with some testing data. The consul has port mapped the the host network namespace correctly, 8500 for example. In toast, I would like to access that port, but I have no way to specify that.
Alternatives considered
I don't think there is a good alternatives for this particular usecase within toast. I can however to package a runtime container myself using toast only as the build step. I can use normal docker build step to copy the binary from toast build steps and execute docker command myself wrapped by a command runner.
Additional context
The change looks to amend the create_container and container_args call to add the --network flag when executing docker cli. We can either allow any network to be passed in from toast and let docker cli return errors in the case that it is incorrect, or specify only dropping to host network as a boolean flag.
If you are open to this feature, I am happy to submit a PR for this.
Description I would like to add an option to specify the network namespace akin to what docker cli
--network
does. In some cases, I would like to drop the container into host network namespace in order to access other resources running on the dev machine. For example, I run a testing consul through the docker compose stack with some testing data. The consul has port mapped the the host network namespace correctly, 8500 for example. In toast, I would like to access that port, but I have no way to specify that.Alternatives considered I don't think there is a good alternatives for this particular usecase within toast. I can however to package a runtime container myself using toast only as the build step. I can use normal docker build step to copy the binary from toast build steps and execute docker command myself wrapped by a command runner.
Additional context The change looks to amend the
create_container
andcontainer_args
call to add the--network
flag when executing docker cli. We can either allow anynetwork
to be passed in from toast and let docker cli return errors in the case that it is incorrect, or specify only dropping to host network as a boolean flag.If you are open to this feature, I am happy to submit a PR for this.