https://pulumi.com logo
Title
q

quiet-truck-58459

05/19/2021, 1:57 PM
To extend my question further can anyone explain why this 👇 code will not pull the latest image on every run?
import time

import pulumi
import pulumi_docker as docker

alpine_remote_image = docker.RemoteImage("alpineRemoteImage",
    name="alpine:latest",
    pull_triggers=[str(time.time())]
)
p

prehistoric-nail-50687

05/19/2021, 2:03 PM
I’m not the top expert on docker, but I think this is because
latest
is just a label as any other (like
v1.1
) and does not have a meaning like: go and get me the latest image you can find. So if there is one with the label
latest
already on your system, then it will use that one. This has nothing to do with pulumi I think.
q

quiet-truck-58459

05/19/2021, 2:03 PM
🤔
I just created a RemoteImage for an image i did not have on my system, and it still didn't pull it.
p

prehistoric-nail-50687

05/19/2021, 2:17 PM
so you created a new image on a different system, pushed it up to the registry and then tried to pull it to your local system?
q

quiet-truck-58459

05/19/2021, 2:19 PM
I just tried to pull a public image which I know was not on my local system
I guess the
RemoteImage
use case & behaviour is not what I think it is.
p

prehistoric-nail-50687

05/19/2021, 2:20 PM
hmm, then I don’t know either
q

quiet-truck-58459

05/19/2021, 2:27 PM
It looks like it just queries the remote server and retrieves information:
OUTPUT               VALUE
    alpine_remote_image  {"build":null,"force_remove":null,"id":"sha256:6dbb9cc54074106d46d4ccb330f2a40a682d49dda5f4844962b7dce9fe44aaecalpine:latest","keep_locally":null,"latest":"sha256:6dbb9cc54074106d46d4ccb330f2a40a682d49dda5f4844962b7dce9fe44aaec","name":"alpine:latest","output":null,"pull_trigger":null,"pull_triggers":null,"urn":"urn:pulumi:staging::nozzle-insights-content-aggregator::docker:index/remoteImage:RemoteImage::alpine-remote-image"}
b

broad-eve-12764

05/19/2021, 4:05 PM
@quiet-truck-58459 are you running
pulumi up
or
pulumi preview
?
q

quiet-truck-58459

05/19/2021, 6:24 PM
@broad-eve-12764 I've tried it with both.
I also ran the RemoteImage against a private image with
pulumi up
. It returned data and a sha256 digest. But the digest did not match anything in the remote repo 🤯
b

broad-eve-12764

05/19/2021, 8:15 PM
I'm running into an issue where digest is different in remote repo, I think different repos define digests differently
q

quiet-truck-58459

05/19/2021, 9:49 PM
Looking at the digest of the remote repo it appears to be using a tag
👍 1