I'm not understanding the Docker context in Container Builder. I have a Dockerfile under services/device-registry/base/build/docker/php/Dockerfile but I want my build context to be services/device-registry My Container Builder step looks like this:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-f', './base/build/docker/php/Dockerfile', '-t', 'gcr.io/$PROJECT_ID/device-registry-php', '.' ]
dir: 'services/device-registry'
id: 'device-registry-php'
And I get the error unable to prepare context: The Dockerfile (/workspace/services/device-registry/base/build/docker/php/Dockerfile) must be within the build context (.)
You this is a docker build
limitation/by-design. This is not related to Google Container Builder.
Files you're sending into to a docker build
command has to be at the SAME or NESTED folders as the Dockerfile
. In your command above, it violates this.