hey all! I have an issue with using Docker storage...
# ask-community
d
hey all! I have an issue with using Docker storage; I am trying to use a pre-built base image, however I get an error (
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: <http+docker://localhost/v1.40/images/create?tag=latest&fromImage=>...
) and docker.errors.ImageNotFound when I try to register the flow. Others have mentioned similar errors in the past, but as far as I saw this was when trying to deploy the flow, not when building the image. Any clues/hints/tips would be appreciated! I'm on OSX using docker-desktop btw, just the default config. Thanks in advance 🙂
j
Do you have docker running? I notice a similar (not sure if exactly same) 404 error when I haven’t started docker yet
d
yep, it's running, also building its own image (i.e. if I don't specify a base_image)
j
Ah alright, then I wouldn’t know. Is your pre-built image on a private registry, if so, maybe prefect needs some authentication details
d
no, it's available locally. according to the docs, no need to push to a remote registry if it's available locally + the agent
Copy code
Note that you don't necessarily need to push your custom base image to a registry; as long as it resides on the machine that you register from, your Docker daemon will be able to use it as your Flow's base image.
j
Hmm then I’m out of ideas, hopefully someone else has a clue 😕
🙏 1
d
tried the same on a Linux machine, same error
d
Hi @Dimitris Stafylarakis, Check out this doc, it has some tips on how to debug Docker Storage https://docs.prefect.io/core/advanced_tutorials/local-debugging.html#locally-check-your-flow-s-docker-storage
d
hey @Dylan thanks! it already fails when trying to build (see snippet below) so already at the first step. I'm suspecting the docker python client..
Copy code
flow = Flow("docker-flow", tasks=[yet_another_task])
flow.storage = Docker(base_image="prefect-local-test:latest")
built_storage = flow.storage.build(push=False)
d
hmmm
z
@Joël Luijmes @Dimitris Stafylarakis I like that ya’ll are helping each other 😄 Great to see. I can try to reproduce this locally later today.
🙌 1
d
that's what communities are for, right?
z
That’s the dream haha
Looks like you’re missing the
local_image
kwarg
Copy code
local_image (bool, optional): an optional flag whether or not to use a
            local docker image, if True then a pull will not be attempted
d
ah cool, seems to work now 👍 thanks
documentation might be a bit misleading here, right?
I'm referring to the part I mention above, it would be good to mention the local_image argument there too!
z
We’d love a clarifying PR 🙂 otherwise it’ll get added to the todo stack!
d
I'm fine submitting one 🙂 just checking that I'm not missing sth obvious being a newbie