rhythmic-glass-66959
07/29/2022, 1:08 PMpants
script? Or maybe an already built Pants Docker image (I can't seem to find one)? I ask because we are using Concourse CI and I want to create a Docker image with Pants pre-installed.wide-midnight-78598
07/29/2022, 1:16 PMrhythmic-glass-66959
07/29/2022, 1:24 PMwide-midnight-78598
07/29/2022, 1:25 PMgit clone git@github.com:pantsbuild/example-python.git
And in there, create this Dockerfile:
FROM python:3.9-bullseye
WORKDIR /app
COPY . /app
CMD ["bash"]
And then build and then
docker run image-name /app/pants lint ::
The optimizations are around storing/caching the Pants cache maybe, so it doesn't re-download each time, so maybe a base Pants 2.x.y image, and then keep the Pants cache as a volumehundreds-father-404
07/29/2022, 3:18 PMancient-vegetable-10556
07/29/2022, 3:19 PMrhythmic-glass-66959
07/29/2022, 5:08 PMpolite-garden-50641
07/29/2022, 5:08 PMrhythmic-glass-66959
07/29/2022, 5:11 PMwide-midnight-78598
07/29/2022, 5:19 PMThe problem I see with this Dockerfile, is that it bootstraps Pants every time you run a command.Yeah for sure, that's what I mentioend above - doesn't cache anything. Previously when I tried something like this, errors were thrown What Asher did was what I was recommending. Essentially, cache all that setup. I was also recommending creating a volume to cache the results of the lockfiles being downloaded and installed too, so that way you can save a step (probably less of a concern in CI?)
rhythmic-glass-66959
07/29/2022, 5:26 PMwide-midnight-78598
07/29/2022, 5:58 PM