fierce-greece-10087
11/28/2024, 2:10 PMdocker_image(
name = "01-base",
instructions = [
"FROM python:3.11.8-slim-bookworm"
]
)
docker_image(
name = "02-app",
dependencies = [
":01-base"
],
instructions = [
"FROM 01-base:latest",
"RUN echo test"
]
)
When I delete the 01-base
image and rerun the pants package
for 02-app
, the build fails because there is no 01-base
image. This happens even though both images are in fact built.
15:02:04.51 [INFO] Completed: Building docker image 01-base:latest
15:02:04.91 [INFO] Completed: Building docker image 02-app:latest
If I just rerun pants package
again, the build succeeds. It seems to me that pants
doesn't wait for the image to be actually available or something. Is this a known issue? Does my approach even make sense or is what I'm doing not "the pants way" of thinking?happy-kitchen-89482
11/28/2024, 2:46 PM01-base
(and the dep to it) and rebuild then the build works because 01-base
exists in my local docker images. But if I docker image rm
it and then rerun then things fail, as expected, because the base image isn’t found by docker.happy-kitchen-89482
11/28/2024, 2:46 PMhappy-kitchen-89482
11/28/2024, 2:48 PM01-base
image” do you mean you docker image rm
it from your local docker state, or do you mean that you delete its target from your BUILD file?happy-kitchen-89482
11/28/2024, 2:49 PMhappy-kitchen-89482
11/28/2024, 2:49 PMhappy-kitchen-89482
11/28/2024, 2:50 PMhappy-kitchen-89482
11/28/2024, 2:51 PMfierce-greece-10087
11/28/2024, 2:52 PMdocker image rm
.happy-kitchen-89482
11/28/2024, 2:57 PMhappy-kitchen-89482
11/28/2024, 3:04 PMhappy-kitchen-89482
11/28/2024, 3:04 PM--no-pantsd
you won’t reproduce thishappy-kitchen-89482
11/28/2024, 3:05 PMhappy-kitchen-89482
11/28/2024, 3:05 PMhappy-kitchen-89482
11/28/2024, 3:07 PMhappy-kitchen-89482
11/28/2024, 3:08 PMhappy-kitchen-89482
11/28/2024, 3:08 PMfierce-greece-10087
11/28/2024, 3:14 PM--no-pantsd
. Thanks!
And yes, it seems that pants repopulates the registry after the error. I would expect that if it doesn't check the cache, it would also fail on all further attempts.happy-kitchen-89482
11/28/2024, 6:58 PMhappy-kitchen-89482
11/28/2024, 6:58 PMhappy-kitchen-89482
11/28/2024, 8:41 PMcurved-television-6568
11/28/2024, 10:26 PMhappy-kitchen-89482
11/29/2024, 12:27 PMhappy-kitchen-89482
11/29/2024, 12:28 PM-ldebug
you see the process actually runninghappy-kitchen-89482
11/29/2024, 12:28 PMhappy-kitchen-89482
11/29/2024, 12:29 PMhappy-kitchen-89482
11/30/2024, 10:20 PMhappy-kitchen-89482
11/30/2024, 10:21 PMhappy-kitchen-89482
11/30/2024, 10:21 PMhappy-kitchen-89482
11/30/2024, 10:21 PMcurved-television-6568
12/01/2024, 7:06 PMhappy-kitchen-89482
12/01/2024, 10:44 PMfierce-greece-10087
12/02/2024, 9:49 AM01-base
and 02-app
images + deleting pants cache. When I try running pants package
on 02-app
, I get the same error, about 01-base
not existing. Even though it was built. So long story short, the same experiment, just with an empty cache.fierce-greece-10087
12/02/2024, 10:08 AM--no-pantsd
flag.happy-kitchen-89482
12/02/2024, 1:10 PMhappy-kitchen-89482
12/02/2024, 1:11 PMcurved-television-6568
12/04/2024, 8:07 AMHow would it know if it is the right image though?By adding a "pants" label to the built image with the cache key.