Here's a <snapshot of my docker plugin so far>. It...
# plugins
f
Here's a snapshot of my docker plugin so far. It supports building, tagging, retagging, and pushing images to a repository (usually via retagging). The source needs to be cleaned up a bit and I need docs and tests added, but it's working well for me in CI and publishing packages to our internal artifactory regularly. I have things set up so running these commands do sort of what you'd expect:
Copy code
./pants package --docker-image-tag="${BUILD_TAG}" $targets
./pants publish --registry=<http://my-docker-registry.company.com:5000|my-docker-registry.company.com:5000> --image-tag="${BUILD_TAG}" $targets
Big thanks to @hundreds-father-404 for the help and patience as I learned the rules API
🔥 3
👍 1
💯 2
One cool feature that it supports (kinda just out of the box thanks to how pants handles dependency graphs) is making docker images that depend on other docker images...this lets you make base images that multiple targets can depend on. This is really more thanks to the pants devs than me 👖 I'm planning on adding support for pulls before builds, and docker-compose at some point as well, as well as publishing this plugin once it gets a bit more stable. I'll have to clear the open-sourcing with work too, but i suspect it will be okay.
👖 1
w
oh man
docker-compose
would be so sweat too, congratz btw great work
f
docker compose is tricky because of the build features
i'm not sure how to make docker-compose know how to call pants to build the image it needs without hooking into buildkit
that's probably the biggest thing with these plugins...it's not that hard to write them once you get the hang of the rules API, but coming up with a clear vision for the use case and how you'll interact with pants takes some time and care to think throuhg
1