How do I expose a port with `./pants run src/docke...
# general
s
How do I expose a port with
./pants run src/docker/Dockerfile
?
c
That's a missing feature.
šŸ˜¢ 1
s
so run doesn't accept any docker argument?
c
Would welcome input on what you think that should look like.
One way would be to simply accept arbitrary args for the run command..
But I would like something more robust, like a ā€œrun configurationā€ that you could pick..
a
I was thinking about some sort of
Procfile
or
docker-compose
system with the latter, something like
./pants docker-compose up
would determine the container dependencies, build the containers, then generate a docker-compose file and
docker-compose up
it. Then (theoretically) when something changes, rebuilds and restarts the container. Ultimately, why reinvent the wheel?
šŸ‘ 1
c
@ambitious-actor-36781 Thanks for that input. Would be great to have a way to use
docker-compose
to setup an entire dev/test env locally, for instance.
Still think it would make sense to have some form of control over how a single image is
run
too, though..
e
In the "short term" what about something like
./pants run $target -- $docker_run_flags
c
Those
$docker_run_flags
are passed to your image entrypoint..
e
Ahh right. Double
--
? Flag after the run goal? Neither option "clean"
c
you mean like
./pants run --args="-p 80 --name foo ā€¦" $target ā€¦
?
a
--docker-args
would be consistent with other subsystems. e.g.
--pytest-args
but then, docker is weird and has two sets of args
docker [global-opts] run [run-opts]
you'd actually need to separate the two.
c
And a third level, to differentiate if it is a docker run, or build, or something else.
s
Is there an issue for this?
c
No, I don't think so. Please feel free to submit one :)
s
sure
c
Thanks.