<p>I am working with Next.js, Kubernetes, ingress-ngninx, and skaffold. I have a Docker file in my next project and I have the repo existing in Dockerhub. When I try to run <code>skaffold dev</code> I keep seeing this error:</p>
<pre><code>build [st3/tickethub-client] failed: could not push image &quot;st3/tickethub-client:36d456b&quot;: tag does not exist: st3/tickethub-client:36d456b
</code></pre>
<p>I tried building the image manually with both a <code>latest</code> tag and the <code>36d456b</code> tag: <code>docker build -t st3/tickethub-client:</code>latest/36d456b. Then I push both to dockerhub successfully. Skaffold dev still fails. I then pull that image after pushing and <code>skaffold dev</code> fails with the same error. I then did a <code>docker prune -a</code> to reset docker to the out of the box settings and still it fails after rebuilding/pushing to docker hub. How do resolve this? And why is it creating one off tags when I am specifying <code>:latest</code> on the builds?</p>
<p>Docker version
<code>Docker version 23.0.0, build e92dd87</code>
Skaffold version <code>v2.0.3</code></p>
<p>client-depl.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: tickethub-client-depl
spec:
  replicas: 1
  # Add selector so depl can find which pods to create
  selector:
    matchLabels:
      app: tickethub-client
  # Pod creation details
  template:
    metadata:
      labels:
        app: tickethub-client
    spec:
      containers:
        - name: tickethub-client
          image: st3/tickethub-client:latest
---
# K8's complimentary tickethub-client service
apiVersion: v1
kind: Service
metadata:
  name: tickethub-client-srv
spec:
  selector:
    # Find matching pods by selector
    app: tickethub-client
  ports:
    - name: tickethub-client
      protocol: TCP
      port: 3000
      targetPort: 3000

</code></pre>
<p>ingress-srv.yaml</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
  rules:
    - host: tickethub.io
      http:
        paths:
          - path: /?(.*) 
            pathType: Prefix
            backend:
              service:
                name: tickethub-client-srv
                port:
                  number: 3000
</code></pre>
<p>Dockerfile</p>
<pre><code># Grab base image
FROM node:alpine

# Set up working directory
WORKDIR /app

# Copy into workdir
COPY package.json .

# Cmd to run
RUN npm install

#Copy everything else from src dir
COPY . .

# Default cmd to run when container is created from this image
CMD [&quot;npm&quot;, &quot;run&quot;, &quot;dev&quot;]
</code></pre>
<p>Output of <code>docker images</code></p>
<pre><code>docker images
REPOSITORY                                 TAG       IMAGE ID       CREATED          SIZE
st3/tickethub-client                 36d456b   d224d808efc7   12 minutes ago   533MB
st3/tickethub-client                 74a97c6   d224d808efc7   12 minutes ago   533MB
st3/tickethub-client                 latest    d224d808efc7   12 minutes ago   533MB
st3/auth                             latest    67b5330b204b   15 minutes ago   371MB
registry.k8s.io/ingress-nginx/controller   &lt;none&gt;    f2e1146a6d96   2 months ago     269MB
k8s.gcr.io/kube-apiserver                  v1.25.2   97801f839490   4 months ago     128MB
k8s.gcr.io/kube-scheduler                  v1.25.2   ca0ea1ee3cfd   4 months ago     50.6MB
k8s.gcr.io/kube-controller-manager         v1.25.2   dbfceb93c69b   4 months ago     117MB
k8s.gcr.io/kube-proxy                      v1.25.2   1c7d8c51823b   4 months ago     61.7MB
registry.k8s.io/pause                      3.8       4873874c08ef   7 months ago     711kB
k8s.gcr.io/etcd                            3.5.4-0   a8a176a5d5d6   8 months ago     300MB
k8s.gcr.io/coredns                         v1.9.3    5185b96f0bec   8 months ago     48.8MB
docker/desktop-vpnkit-controller           v2.0      8c2c38aa676e   21 months ago    21MB
docker/desktop-storage-provisioner         v2.0      99f89471f470   21 months ago    41.9MB

</code></pre>
<p>I am out of ideas at this point.</p>

CodeConnoisseur
<p>I was able to finally get this to work:</p>
<p>Running <code>docker system prune -a --volumes</code> to remove EVERYTHING locally for docker and then re-building the images and pushing to dockerhub seemed to have worked. Not 100% this will be a catch all solution for everyone since it removes all stuff from local (I don't mind since this is dev work anyway).</p>
