This message was deleted.
# getting-started
s
This message was deleted.
s
From your description, this sounds like a Kubernetes-Docker issue, not a Pulumi issue. You’re trying to use a container stored in the local Docker storage with Kubernetes, and Kubernetes is trying to pull it from a registry (which the local Docker storage is not). You’ll need to run a local registry and have your Pulumi code push the built container image to the registry, then have Kubernetes pull from that registry.
f
It feels a little crazy to have to do this when "just trying this solution". So tried (not really thinking it'd work) to use
eval $(minikube docker-env)
in the terminal I do
pulumi up
. To no avail as it would have been too easy. Next, let's register the image created with minikube.
Copy code
artifacts = docker.Image(
    "artifacts-image",
    build=docker.DockerBuildArgs(
        context="./artifacts",
        dockerfile="artifacts/Dockerfile",
    ),
    image_name="artifacts",
    skip_push=True
)

os.system("minikube image load artifacts")
Little
minikube image ls
and yup
<http://docker.io/library/artifacts:latest|docker.io/library/artifacts:latest>
looks to be present. But the container can't pull it it seems. Let's update its policy with
Copy code
artifacts_container = ContainerArgs(
    name="artifacts-container",
    image=artifacts.image_name,
    image_pull_policy="Never",
)
Still not enough. So yeah time to setup a local image repository.
Although I don't see the utility of the skip_push option if there is no way to not have to pull the image after creating it.
s
You might use the
skip_push
if you are just working locally with Docker (like building the image and then running a container from that image). The wrinkle here is Kubernetes. Sorry for the extra work of having to stand up a repository (there’s a quick-and-dirty registry you can run as a container, FWIW), but this is outside our control.
f
Woot, tried again a little more fresh and using the basic docker registry in localhost and it worked! Thanks for the explanations and pointers.