google cloud container registry error: "Failed to trigger build: Request contains an invalid argument."

5/28/2018

What's wrong?

I used the google cloud GUI to create a container build trigger for my project.
The trigger is linked to my GC repository. It generated the following:

docker build \
    -t gcr.io/myprojectid/$REPO_NAME:$COMMIT_SHA \
    -f Dockerfile \
    .

Whenever this trigger runs, I get the message:

"Failed to trigger build: Request contains an invalid argument."

If I inspect the build details it says:

invalid build: invalid image "gcr.io/myprojectid/myreponame:mycommitsha"

Logs are unavailable. I tried this for two seperate services in seperate repositories, both with the same result.

This is one of the dockerfile's I'm trying to build. They build just fine on my laptop.

FROM python:3.6

WORKDIR /usr/src/app

RUN pip3 install --upgrade pip && \
pip3 install numpy && \
pip3 install pandas && \
pip3 install sqlalchemy && \
pip3 install psycopg2-binary && \
pip3 install sklearn && \
pip3 install tensorflow && \
pip3 install keras 


COPY . .

# Tensorboard
EXPOSE 6006 

CMD python -u ./trainer.py 
-- Rick vm
docker
google-cloud-platform
google-kubernetes-engine

1 Answer

7/28/2018

I tried to repro your configuration and it worked for me.

Build Trigger:

enter image description here

I'm using a Source Repository only for convenience:

enter code here

and:

enter image description here

When I push, it builds correctly:

enter image description here

And I get an image in Container Registry:

enter image description here

HTH!

-- DazWilkin
Source: StackOverflow