-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code reloading for ./pants run src/docker/hw/Dockerfile
through mounts
#15925
Comments
@stuhood for this, I'm considering we could add a |
Having a long-lived docker process which stayed up through multiple iterations would require some mutable state passed into the engine invokes, most likely (and then torn down at the end). In that regard, It's possible that a cleaner implementation though would be to add native docker support to Pants (via a rust side |
Makes sense, thanks. |
That's right. |
Just adding another thought to this discussion. I have another usecase that goes a little further. I am not using pants to run that container, but use it for building/publishing the image and then deploy it to localstack. Now I would like to specify to hot reload the pants artifact in the container that is now run by localstack. |
Is your feature request related to a problem? Please describe.
Here pantsbuild/example-docker#6 it was discussed that the current implementation of running a Docker container with pants and
restartable=True
does not feature a great developer experience for developing/debugging purposes as it will rebuild the container on every code change.Describe the solution you'd like
I am not sure if there are use cases for the current setup that are not covered by the following solution, so I am not certain if the current implementation should be replaced or extended. I would like
./pants run src/docker/hw/Dockerfile
to do:--build
flag could be added to the./pants run
command, similiar todocker-compose up --build serviceA
--force-recreate
So basically re-use the container.
Describe alternatives you've considered
To a certain extend, i.e. user code but not third party/user dependencies, it is possible for the AWS Lambda case as here the PEX will be unzipped:
./pants run --docker-run-args="-v ./lambda_example.py:/app/lambda_example.py" project:my_image
Additional context
The same would be benefical for running tests in a container (#13682) as you would not want the container to be rebuild for eacht test run.
The text was updated successfully, but these errors were encountered: