<https://github.com/PrefectHQ/prefect/discussions/...
# ask-community
k
Hey @Martin Felder! No worries! The issue here is that activating a conda environment is tricky in general and the way you have there won’t work. This is the best article I’ve seen how to get it to work. But you also seem to have other issues. Are you building the container on a different place than the agent is running on?
m
Hi @Kevin Kho, well, the article you mention is the same one I mention in my Discussion post 😉 And at least for the command line, it does seem to work. I'm building the container on the same machine as everything else that is running. Could it be that docker gets confused with all the rebuilds? Maybe I should start from scratch?
k
Oh my bad I missed that. It seems like the bigger issue is that the container is not found then. I think this might be separate from conda. What Storage are you using for the Flow?
m
I'm not explicitly specifying storage, so I suppose that defaults to LocalStorage?
k
Yeah that should be fine. Was just wondering if you were using Docker Storage. This setup is fine though. I am confused why the agent can’t pick up the Docker container. Could you tag it something different than latest?
I am wondering if registering saves the container hash and future builds of the container are changing it so there is a mismatch?
m
That was my suspicion, too. But I could not unequivocally verify it. I think I'm just going to delete all docker images and containers and start afresh. Assuming that solves the containier issue, do you have an idae about the [tini]-error? How exactly is the flow code executed in the container? As I wrote, if I do
docker run ... bash
I end up as the correct user and with the conda env activated. Will this be true for the flow as well?
k
tini
is the entrypoint of the container. No idea at the moment. Commands are added to the container including the commands to run the Flow. Which method did you use to activate the conda environment? If it’s using the entrypoint, we might be overwriting that. But I think the symptom there would be that loading modules fails while the error we have is about not finding the image at all.
m
Ahh, I see - so Prefect is just laying down a few extra layers for the container? Interesting! Since right now I don't have an entrypoint defined, maybe I should try that for starters.
k
Yes that’s right! You wont need the ENTRYPOINT (but you do need a way to activate the conda environment)