few-byte-5272904/28/2023, 1:55 PM
artifacts = docker.Image( "artifacts-image", build=docker.DockerBuildArgs( context="./artifacts", dockerfile="artifacts/Dockerfile", ), image_name="artifacts", skip_push=True ) artifacts_container = ContainerArgs( name="artifacts-container", image=artifacts.image_name, ) deployment = Deployment( "backend", metadata=backend_metadata, spec=DeploymentSpecArgs( replicas=1, selector=app_selector, template=PodTemplateSpecArgs( metadata=backend_php_metadata, spec=PodSpecArgs( volumes=[ ], init_containers=[ artifacts_container, ], containers=[ ], ), ), ), )
gives me the message
warning: [Pod backend-95bd4bd6-5c4c5f594c-bqb8t]: containers with incomplete status: [artifacts-container]
shows the error
kubectl describe pod backend-95bd4bd6-5c4c5f594c-bqb8t
but the image is shown by
Failed to pull image "artifacts": rpc error: code = Unknown desc = Error response from daemon: pull access denied for artifacts, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
so it looks like it tries to get from some provider instead of locally. Is there a config somewhere to get images locally? https://github.com/pulumi/pulumi-docker/issues/148 was not really helpful or I must have missed something.
docker image ls
salmon-account-7457204/28/2023, 2:27 PM
few-byte-5272904/28/2023, 5:52 PM
in the terminal I do
eval $(minikube docker-env)
. To no avail as it would have been too easy. Next, let's register the image created with minikube.
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")
minikube image ls
looks to be present. But the container can't pull it it seems. Let's update its policy with
Still not enough. So yeah time to setup a local image repository.
artifacts_container = ContainerArgs( name="artifacts-container", image=artifacts.image_name, image_pull_policy="Never", )
salmon-account-7457204/28/2023, 7:49 PM
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.
few-byte-5272904/29/2023, 2:43 PM