Q:

GC Cloud Build custom build process with internal repostory

I have to configure custom build process of GC AppEngine application with GC Cloud Build. 
First of all - I have an internal python repository on the GC ComputeEngine instance.  It's accessible only through internal network and I use Remote-builder to run pip installcommand on the internal GC instance. 
After downloading of dependencies from the internal repository I have to deploy results into the GC AppEngine. 
Cloudbuild.yaml:
steps:
/#Download dependencies from the internal repository
- name: gcr.io/${ProjectName}/remote-builder
  env:
  - COMMAND=sudo bash workspace/download-dependencies.bash
  - ZONE=us-east1-b
  - INSTANCE_NAME=remote-cloud-build
  - INSTANCE_ARGS=--image-project centos-cloud --image-family centos-7
- name: gcr.io/cloud-builders/docker
  args: ['build', '-t', 'gcr.io/${ProjectName}/app', '.'] 
- name: gcr.io/cloud-builders/docker
  args: ['push', 'gcr.io/${ProjectName}/app']
- name: gcr.io/cloud-builders/gcloud
  args: ['app', 'deploy', 'app.yaml', '--image-url=gcr.io/${ProjectName}/${ProjectName}']
images: ['gcr.io/${ProjectName}/${ProjectName}']
app.yaml:
runtime: python
env: flex
entrypoint: python main.py
service: service-name
runtime_config:
  python_version: 3

Dockerfile:
FROM gcr.io/google-appengine/python
WORKDIR /app
COPY .  /app
download-dependencies.bash:
#! /usr/bin/env bash
easy_install pip
pip install --upgrade pip
pip install --upgrade setuptools
pip install -r workspace/requirements.txt'
After running of gcloud builds submit --config cloudbuild.yaml
 new version of the application is deployed on the AppEngine but it doesn't work
Maybe the issue is the wrong image?  As far as I understand, I need to configure Dockefile to collect all custom python dependencies into the image. 
Could you please help me with it
Thanks in advance! 
Update
I changed my Dockerfile according to the google guidline:
FROM gcr.io/google-appengine/python
RUN virtualenv /env
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
ADD .  /app
CMD main.py
And new error is: /bin/sh: 1: main.py: not found
If I change last line to: CMD app/main.py - it creates version and doesn't work

A:

Finally, I finished.  There were some issues and I will share right configs below.  Hope it will help someone. 
steps:
# Move our code to instance inside the project to have access to the private repo
- name: gcr.io/${PROJECT_NAME}/remote-builder
  env:
  - COMMAND=sudo bash workspace/download-dependencies.bash:
  - ZONE=us-east1-b
  - INSTANCE_NAME=remote-cloud-build
  - INSTANCE_ARGS=--image-project centos-cloud --image-family centos-7
#Build image with downloaded deps
- name: gcr.io/cloud-builders/docker
  args: ['build', '-t', 'gcr.io/${PROJECT_NAME}/${APP_NAME}', '.'] 
#Push image to project repo
- name: gcr.io/cloud-builders/docker
  args: ['push', 'gcr.io/${PROJECT_NAME}/${APP_NAME}']
#Deploy image to AppEngine
- name: gcr.io/cloud-builders/gcloud
  args: ['app', 'deploy', 'app.yaml', '--image-url=gcr.io/${PROJECT_NAME}/${APP_NAME}']
images: ['gcr.io/${PROJECT_NAME}/${APP_NAME}']
timeout: '1800s'

download-dependencies.bash:
#! /usr/bin/env bash
easy_install pip

pip install --upgrade pip
pip install --upgrade setuptools
pip install wheel
#Download private deps and save it to volume (share folder between steps)
pip wheel --no-deps -r workspace/private-dependencies.txt -w workspace/lib --no-binary :all:

Dockerfile:
FROM gcr.io/google-appengine/python
COPY .  /${APP_NAME}
RUN virtualenv /env

ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH

RUN pip install -r /${APP_NAME}/workspace/public-dependencies.txt
#Install private deps from volume
RUN pip install -f /${APP_NAME}/workspace/lib --no-index ${LIBRARY_NAME}

CMD gunicorn -b :$PORT main:app

