For local development, I am using Docker inside a Minikube cluster. I would like to build the image and then apply it to the cluster directly without the image being published to some remote registry.
Unfortunately, when not providing a registry in the image name, k8s_object seems to fall back to index.docker.io.
Example
Assume a Docker target (:image) that builds an image with the following name: bazel/services/api:image
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-deployment
labels:
app: api
spec:
selector:
matchLabels:
app: api
replicas: 1
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: bazel/services/api:image
imagePullPolicy: Never
Now, when running bazel run //services/api:k8s.resolve -- --no_push=true, the image is resolved to index.docker.io/bazel/services/api@sha256:3ebdf5964644a7aba0b4cde6baa5fd1c822ee61f784ca2c3b6cc5cf29bd72270
How can I disable the fallback to index.docker.io so that the image name resolves to bazel/services/api@sha256:3ebdf5964644a7aba0b4cde6baa5fd1c822ee61f784ca2c3b6cc5cf29bd72270?
Setting image_chroot with an empty string does not work.
For local development, I am using Docker inside a Minikube cluster. I would like to build the image and then apply it to the cluster directly without the image being published to some remote registry.
Unfortunately, when not providing a registry in the image name,
k8s_object
seems to fall back toindex.docker.io
.Example Assume a Docker target (
:image
) that builds an image with the following name:bazel/services/api:image
BUILD.bazel:
k8s.yaml
Now, when running
bazel run //services/api:k8s.resolve -- --no_push=true
, the image is resolved toindex.docker.io/bazel/services/api@sha256:3ebdf5964644a7aba0b4cde6baa5fd1c822ee61f784ca2c3b6cc5cf29bd72270
How can I disable the fallback to
index.docker.io
so that the image name resolves tobazel/services/api@sha256:3ebdf5964644a7aba0b4cde6baa5fd1c822ee61f784ca2c3b6cc5cf29bd72270
?Setting
image_chroot
with an empty string does not work.Thanks!