Can docker_environment point to an image defined b...
# general
a
Can docker_environment point to an image defined by docker_image. For now, I'm just getting 404 because the image can't be found. if i "pants package :my_image" first it works but it seems to disappear between github action steps
l
Unfortunately no, we had the same problem (wanting to run smoke tests inside a container) and our solution was just to always run
pants package
first.
a
hrm. that'll make a little more of a hard sell outside CI/CD
w
https://github.com/pantsbuild/pants/issues/17714 Ticket there - I prototyped it but lost the code, but the work wasn't very hard. Just weird one cyclic dep
a
if I could pre-hook the test execution in a plugin then that would work. I can add the field jst fine:
Copy code
return [DockerEnvironmentTarget.register_plugin_field(EnvDependencyField)]
I''m surprised this doesn't work too
Copy code
__defaults__(
    {
        (python_tests): dict(environment="my_env", runtime_package_dependencies=[":my_docker_img"]),
    }
)
p
I would like to see that issue resolved. So, I'm noodling on how to make this happen. For now, I'm looking for something I could refactor that would make some of the docker image build stuff available within rust to prepare for this. I only have a bit of time here and there to work on this though. so don't expect a fast turn around 😛
a
Got it. I'm also now looking at how I can hook into the publish workflow to run grype and syft (security tools) so I'm looking around in the docker backend python code itself. lmk if i can test or write anything.
p
I'm mostly just poking around right now with loose ideas on what might help. 🤷