This message was deleted.
# rancher-desktop
a
This message was deleted.
h
I have been running docker with k3d directly for use with skaffold but was hoping RD could drop in as a replacement for better cross platform support
f
The images should be visible to Kubernetes if you are using moby. One common pitfall is that if you use the
latest
tag on the image, then you need to explicitly specify an
imagePullPolicy
of
IfNotPresent
or
Never
because the default for the
latest
tag is
Always
, which will try to download the image from DockerHub even if it already exists locally. https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
• if you omit the
imagePullPolicy
field, and the tag for the container image is
:latest
,
imagePullPolicy
is automatically set to `Always`;
h
Hey I appreciate your response! I think im missing something. I tried running with the image pull policy as you describe but it doesn't see the container and if i do
Copy code
rdctl shell docker images
i don't see the image in that registry. I tried disabling build kit too but didn't seem to work. im using the rancher expressapp from https://github.com/rancher-sandbox/docs.rancherdesktop.io currently running something like this
Copy code
Rancher-Desktop-Example> pwd
<http://docs.rancherdesktop.io/assets/express-sample|docs.rancherdesktop.io/assets/express-sample>
Rancher-Desktop-Example> which docker
~/.rd/bin/docker
Rancher-Desktop-Example> docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
Rancher-Desktop-Example> rdctl shell docker images
REPOSITORY                                          TAG                    IMAGE ID       CREATED         SIZE
rancher/local-path-provisioner                      v0.0.27                c45111663115   2 months ago    49.3MB
rancher/klipper-helm                                v0.8.4-build20240523   0c1204a22f13   2 months ago    263MB
bitnami/postgresql                                  16.2.0-debian-12-r6    11ce3d26089c   4 months ago    1.04GB
rancher/klipper-lb                                  v0.4.7                 edc812b8e25d   5 months ago    11.8MB
rancher/mirrored-library-traefik                    2.10.7                 ee69e8120b64   6 months ago    153MB
rancher/mirrored-metrics-server                     v0.7.0                 b9a5a1927366   6 months ago    66.8MB
rancher/mirrored-library-busybox                    1.36.1                 65ad0d468eb1   14 months ago   4.26MB
rancher/mirrored-coredns-coredns                    1.10.1                 ead0a4a53df8   18 months ago   53.6MB
rancher/mirrored-pause                              3.6                    6270bb605e12   2 years ago     683kB
<http://ghcr.io/rancher-sandbox/rancher-desktop/rdx-proxy|ghcr.io/rancher-sandbox/rancher-desktop/rdx-proxy>   latest                 7eb0b6662e89   54 years ago    5.3MB
Rancher-Desktop-Example> ls
app.js  bin  Dockerfile  manifests.yaml  package.json  public  routes  views
Rancher-Desktop-Example> docker build -t expressapp:v1.0 . --load
[+] Building 12.0s (13/13) FINISHED                                                                                                                                                                                  docker-container:default
 => [internal] booting buildkit                                                                                                                                                                                                       9.4s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                                                       8.8s
 => => creating container buildx_buildkit_default                                                                                                                                                                                        0.6s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 382B                                                                                                                                                                                                     0.0s
 => [internal] load metadata for <http://docker.io/library/node:lts-alpine|docker.io/library/node:lts-alpine>                                                                                                                                                                       0.5s
 => [internal] load .dockerignore                                                                                                                                                                                                        0.0s
 => => transferring context: 402B                                                                                                                                                                                                        0.0s
 => [1/6] FROM <http://docker.io/library/node:lts-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52|docker.io/library/node:lts-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52>                                                                                                                 0.0s
 => => resolve <http://docker.io/library/node:lts-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52|docker.io/library/node:lts-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52>                                                                                                                 0.0s
 => [internal] load build context                                                                                                                                                                                                        0.0s
 => => transferring context: 1.37kB                                                                                                                                                                                                      0.0s
 => CACHED [2/6] WORKDIR /usr/src/app                                                                                                                                                                                                    0.0s
 => CACHED [3/6] COPY [package.json, package-lock.json*, npm-shrinkwrap.json*, ./]                                                                                                                                                       0.0s
 => CACHED [4/6] RUN npm install --production --silent && mv node_modules ../                                                                                                                                                            0.0s
 => [5/6] COPY . .                                                                                                                                                                                                                       0.0s
 => [6/6] RUN chown -R node /usr/src/app                                                                                                                                                                                                 0.1s
 => exporting to docker image format                                                                                                                                                                                                     1.8s
 => => exporting layers                                                                                                                                                                                                                  0.1s
 => => exporting manifest sha256:56ae2e04a8a11f1f2b425f6c2cd116eab713812f30ef08afcc3d18cc9c015cb7                                                                                                                                        0.0s
 => => exporting config sha256:fa5d9beedcf30d27eb9a8d5256d2c634e54e7db960ea8b8217c8bf15e78349fb                                                                                                                                          0.0s
 => => sending tarball                                                                                                                                                                                                                   1.6s
 => importing to docker                                                                                                                                                                                                                  0.0s
Rancher-Desktop-Example> docker images
REPOSITORY      TAG               IMAGE ID       CREATED          SIZE
moby/buildkit   buildx-stable-1   f836cfaa6d36   7 days ago       203MB
expressapp      v1.0              fa5d9beedcf3   14 seconds ago   155MB
Rancher-Desktop-Example> rdctl shell docker images
REPOSITORY                                          TAG                    IMAGE ID       CREATED         SIZE
rancher/local-path-provisioner                      v0.0.27                c45111663115   2 months ago    49.3MB
rancher/klipper-helm                                v0.8.4-build20240523   0c1204a22f13   2 months ago    263MB
bitnami/postgresql                                  16.2.0-debian-12-r6    11ce3d26089c   4 months ago    1.04GB
rancher/klipper-lb                                  v0.4.7                 edc812b8e25d   5 months ago    11.8MB
rancher/mirrored-library-traefik                    2.10.7                 ee69e8120b64   6 months ago    153MB
rancher/mirrored-metrics-server                     v0.7.0                 b9a5a1927366   6 months ago    66.8MB
rancher/mirrored-library-busybox                    1.36.1                 65ad0d468eb1   14 months ago   4.26MB
rancher/mirrored-coredns-coredns                    1.10.1                 ead0a4a53df8   18 months ago   53.6MB
rancher/mirrored-pause                              3.6                    6270bb605e12   2 years ago     683kB
<http://ghcr.io/rancher-sandbox/rancher-desktop/rdx-proxy|ghcr.io/rancher-sandbox/rancher-desktop/rdx-proxy>   latest                 7eb0b6662e89   54 years ago    5.3MB
sorry that is a little gross without coloring. Idk if you have any ideas but im happy to provide any other info. I do see a local docker socker in
~/.rd/docker.sock
in not 100% how this should work but with something like minikube i would need the DOCKER_HOST set or something to use the docker on the host? should the images be mounted into the vm or something?
f
Do you have another docker daemon running on your machine? What is the output of
docker context ls
?
The fact that you get different output from
docker images
vs
rdctl shell docker images
would indicate that you are talking to a different docker socket on the host
h
oh man i think you nailed it
f
Use
docker context use rancher-desktop
to switch if you are using a different daemon on the host.
h
im rebuilding with --context rancher-desktop now
f
But it would be best to run only a single one
h
yup!
thank you so much!
f
You are welcome!
h
i see the image with
Copy code
Rancher-Desktop-Example> rdctl shell docker images
REPOSITORY                                          TAG                    IMAGE ID       CREATED          SIZE
expressapp                                          v1.0                   947aae077eee   21 seconds ago   151MB
f
That explains why Kubernetes couldn't see it
h
makes perfect sense! i didn't check that and it was making me doubt my understanding haha
thanks again