https://garden.io logo
#🌱|help-and-getting-started
Local docker registry
# 🌱|help-and-getting-started
b

blue-kite-93685

03/03/2023, 10:48 AM
I'm having some trouble figuring out how garden builds interact with docker registries. I'm trying to develop entirely locally for the moment. Whether I use local-docker or cluster-buildkit, my deploys fail with "Error response from daemon: pull access denied for image, repository does not exist or may require 'docker login'", which doesn't seem right. The images in question do visibly exist as far as my host docker daemon is concerned. What do I need to do for garden to be able to deploy them?
I tried setting deploymentRegistry: hostname: localhost port: 5000 insecure: true in my provider but this doesn't seem to have helped, it's still using an unqualified image name in the deployment and at a guess it's trying to pull from docker.io. How can I confirm that? How can I change that?
I am realising garden may be trying to use an internal cluster registry instead, except it doesn't exist. I've ran garden plugins local-kubernetes cluster-init in my local environment, but that hasn't made it exist. It put a configmap and a serviceaccount in my garden-system namespace, but nothing else. What am I missing? I do not have a deploymentRegistry defined, and I have tried this with a completely blank environment several times.
b

bright-policeman-43626

03/03/2023, 3:33 PM
Hey @blue-kite-93685 I’m so sorry you are getting this issues, let’s try to find the root cause for this one! Would you mind sharing the project configuration you have for this deployment? Thank you!🌸
b

blue-kite-93685

03/03/2023, 3:35 PM
b

bright-policeman-43626

03/03/2023, 3:44 PM
please let me give it a quick test if you don't mind!
I'm going to add a quick dockerfile that bootstrap a react application to test this one! Will update in a couple of minutes.
b

blue-kite-93685

03/03/2023, 3:50 PM
the cluster-init output doesn't really seem to suggest it's trying to create an in-cluster registry
b

bright-policeman-43626

03/03/2023, 4:08 PM
Sorry one more question, to run docker are you currently using
docker-desktop
?
b

blue-kite-93685

03/03/2023, 4:08 PM
Yep
Rancher-desktop is providing a k3s cluster with docker desktop as the container engine
I can't work out what the intended behaviour is meant to be to be honest. What does local-docker use by default to get images to the cluster? I'm slightly surprised it needs to pull anything per se
b

bright-policeman-43626

03/03/2023, 4:09 PM
Do you mind checking if you are using dockerd for rancher k3s?
b

blue-kite-93685

03/03/2023, 4:10 PM
b

bright-policeman-43626

03/03/2023, 4:10 PM
do you mind doing a
garden delete environment
and
rm -fr .garden
b

blue-kite-93685

03/03/2023, 4:10 PM
I've been doing that all day ;p suresure.
b

bright-policeman-43626

03/03/2023, 4:10 PM
And remove the
buildMode: local-docker
and then deploy again
b

blue-kite-93685

03/03/2023, 4:11 PM
oh. just no buildmode? haven't tried that
b

bright-policeman-43626

03/03/2023, 4:12 PM
Yes please try that, usually when I'm local I don't have to set that up and it works, maybe try doing the cleanup and then deploy without that!
b

blue-kite-93685

03/03/2023, 4:14 PM
nm, didn't do that quite right (taking a lil while to take the env down, bear with me.)
b

bright-policeman-43626

03/03/2023, 4:20 PM
no worries! I'm here!
b

blue-kite-93685

03/03/2023, 4:22 PM
mmyeah. much the same.
b

bright-policeman-43626

03/03/2023, 4:23 PM
can you please do
cat ~/.docker/config.json
b

blue-kite-93685

03/03/2023, 4:25 PM
not much of interest set up - what're you looking for? I'm on windows, so it's using the windows crential store
there's no entry for e.g. an in-cluster registry if that's the idea
b

bright-policeman-43626

03/03/2023, 4:34 PM
I was trying to see if maybe there is a misconfiguration of the registries, it seems like yours is trying to go directly to docker hub instead of locally. Have you tried
kaniko
as buildMode? When you set that one Garden deploys a registry for you in the cluster. I'm currently checking into that option with my local environment
b

blue-kite-93685

03/03/2023, 4:36 PM
Pulling unqualified names from docker.io is default behaviour afaik
b

bright-policeman-43626

03/03/2023, 4:36 PM
I was able to reproduce the issue you are having but to be fair I have a really conflicted installation of Docker atm as I installed docker-desktop but also have docker running at the system level in Linux
b

blue-kite-93685

03/03/2023, 4:36 PM
heh
I have not played with kaniko yet, I'll give that a try. I did try cluster buildkit, which didn't seem to change much, but I'm not sure I gave it an adequate reset
b

bright-policeman-43626

03/03/2023, 4:38 PM
yeah when resetting the stuff try to always delete the metadata, I'm currently testing kaniko, It seems like it installed the registry in the cluster locally successfully.
b

blue-kite-93685

03/03/2023, 4:47 PM
I ran the self-update along the way and now it's just giving me
Path C:\Users\<user>\.garden\bin\static is not in a git repository root.
while my cwd is definitely that of my project. 🙃
b

bright-policeman-43626

03/03/2023, 4:49 PM
I'm so sorry that this is being to painful, I don't have a lot of experience with Windows, but maybe the self-update command did not properly installed the new binary?
b

blue-kite-93685

03/03/2023, 4:51 PM
replaced with the backup. crisis averted..
b

bright-policeman-43626

03/03/2023, 4:51 PM
Hey good news, Kaniko ended up working for me. I just followed the steps: 1.
garden delete environment
2.
rm -fr .garden
3. Change buildMode to
kaniko
4.
garden deploy
5. You can open a different terminal and some pods should be created "garden-registry-proxy, garden-docker-registry, etc
do you mind trying the above?
b

blue-kite-93685

03/03/2023, 4:51 PM
yepyep
b

bright-policeman-43626

03/03/2023, 4:54 PM
I can upload my whole project if you want to take a look?
b

blue-kite-93685

03/03/2023, 4:58 PM
🎉 All green
Thanks a bunch for your help 😛
b

bright-policeman-43626

03/03/2023, 4:59 PM
No worries! I hope the best for your project and thanks for using Garden! 🌸
q

quaint-dress-831

09/05/2023, 7:26 AM
@blue-kite-93685 with 0.13.13 we now ship first-class support for Rancher Desktop 🥂
6 Views