user23232468
user23232468

Reputation: 33

cloud run - build : Your build failed to run: invalid build: invalid image name

iam trying to create and run a cloud trigger but every time i run it it says : Failed to trigger build: invalid build: invalid image name "gcr.io/dashs70e/prName:ef50014": could not parse reference: gcr.io/dashs70e/prName:ef50014 .

iam trying to build it using cloudbuild.yaml file

Dockerfile :

FROM node:18
WORKDIR /nest-app
COPY package.json /nest-app
RUN npm install
COPY . /nest-app
EXPOSE 3000
CMD ["npm", "run", "start:dev"]

docker-compose

version: '3'

services:
  nest-app:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/nest-app
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: development

cloudbuild.yaml

steps:
  - name: 'gcr.io/cloud-builders/docker'
    id: Build
    args:
      - 'build'
      - '-t'
      - 'gcr.io/$PROJECT_ID/prName:$SHORTT_SHAAA'
      - '.'

  - name: 'gcr.io/cloud-builders/docker'
    id: Push
    args:
      - 'push'
      - 'gcr.io/$PROJECT_ID/prName:$SHORTT_SHAAA'

    
  - name: 'gcr.io/cloud-builders/gcloud'
    args:
      - 'run'
      - 'deploy'
      - 'cld-run'
      - '--image'
      - 'gcr.io/$PROJECT_ID/prName:$SHORTT_SHAAA'
      - '--region'
      - 'europe-west1'
      - '--platform'
      - 'managed'
      - '--allow-unauthenticated'
images:
  - 'gcr.io/$PROJECT_ID/prName:$SHORTT_SHAAA'

i go to triggers and create one then i connect to my github repo , select Cloud Build configuration file (yaml or json) from Configuration but i get this error

Upvotes: 1

Views: 350

Answers (0)

Related Questions