title: manifest unknown: Failed to fetch \"latest\" from request \"/v2/$PROJECT_ID/$IMAGE:latest/manifests/latest\ "."
body: <p>I have some python files inside of a VM that will run every week to scrape info from a website. This is automated through cloud scheduler and cloud function and it is confirmed that it works. I wanted to use cloud build and cloud run to update the code inside of the VM each time I update the code inside of the Github. I read somewhere that in order to deploy a container image to a VM, the VM has to have a container-os, so I manually made a new VM matching that criteria through compute engine. The container-os VM is already made. I just need to have the container image for it updated with the new container image built with the updated code from Github.</p>
  <p>I'm trying to build a container image that I will later use to update the code inside of a virtual machine. Cloud run is triggered every time I push to a folder in my Github repository.</p>
  <p>I checked Container Registry and the images are being created, but I keep getting this error when I check the virtual machine:</p>
  <pre><code>&quot;Error: Failed to start container: Error response from daemon:
  {
    &quot;message&quot;:&quot;manifest for gcr.io/$PROJECT_ID/$IMAGE:latest not found: manifest unknown: Failed to fetch \&quot;latest\&quot; from request \&quot;/v2/$PROJECT_ID/$IMAGE:latest/manifests/latest\&quot;.&quot;
  }&quot; 
  </code></pre>
  <p>Why is the request being made for the latest tag when I wanted the tag with the commit hash and how can I fix it?</p>
  <p>This is the virtual machine log (sudo journalctl -u konlet-startup):</p>
  <pre><code>Started Containers on GCE Setup.
  Starting Konlet container startup agent
  Downloading credentials for default VM service account from metadata server
  Updating IPtables firewall rules - allowing tcp traffic on all ports
  Updating IPtables firewall rules - allowing udp traffic on all ports
  Updating IPtables firewall rules - allowing icmp traffic on all ports
  Launching user container $CONTAINER
  Configured container 'preemptive-public-email-vm' will be started with name 'klt-$IMAGE-xqgm'.
  Pulling image: 'gcr.io/$PROJECT_ID/$IMAGE'
  Error: Failed to start container: Error response from daemon: {&quot;message&quot;:&quot;manifest for gcr.io/$PROJECT_ID/$IMAGE:latest not found: manifest unknown: Failed to fetch \&quot;latest\&quot; from request \&quot;/v2/$PROJECT_ID/$IMAGE/manifests/latest\&quot;.&quot;}
  Saving welcome script to profile.d
  Main process exited, code=exited, status=1/FAILURE
  Failed with result 'exit-code'.
  Consumed 96ms CPU time
  </code></pre>
  <p>This is the cloudbuild.yaml:</p>
  <pre><code>steps:
  - name: 'gcr.io/cloud-builders/docker'
    args: ['build', '-t', 'gcr.io/$PROJECT_ID/$IMAGE:$COMMIT_SHA', './folder_name']
  - name: 'gcr.io/cloud-builders/docker'
    args: ['push', 'gcr.io/$PROJECT_ID/$IMAGE:$COMMIT_SHA']
  - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
    entrypoint: gcloud
    args:
    - 'run'
    - 'deploy'
    - 'run-public-email'
    - '--image'
    - 'gcr.io/$PROJECT_ID/$IMAGE:$COMMIT_SHA'
    - '--region'
    - 'us-central1'
  images:
  - 'gcr.io/$PROJECT_ID/$IMAGE:$COMMIT_SHA'
  </code></pre>
  <p>This is the dockerfile:</p>
  <pre><code>FROM python:3.9.7-slim-buster
  
  WORKDIR /app
  
  COPY requirements.txt requirements.txt
  RUN pip3 install -r requirements.txt
  
  COPY . .
  
  CMD [ &quot;python3&quot;, &quot;hello.py&quot; ]
  </code></pre>
  <p>This is hello.py:</p>
  <pre><code>import os
  
  from flask import Flask
  
  app = Flask(__name__)
  
  @app.route('/')
  def home():
      return &quot;Hello world&quot;
  
  if __name__ == '__main__':
      app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
  </code></pre>