(question moved from the Bitbucket section)
We have a simple app we're trying to build in much the same vein as this article:
https://confluence.atlassian.com/bitbucket/build-and-push-a-docker-image-to-a-container-registry-884351903.html
We have everything the app needs except the repo on a private image in GCR. We've set up a pipelines yml as close to the example as we can get, but when it gets to the docker build portion, it throws this error:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /opt/atlassian/pipelines/agent/build/Dockerfile: no such file or directory
What we want to happen here is for Pipelines to take our base image (image A), clone the repo into a folder on that image, and then push the resulting image back up as a production-ready image (image B, which is just image A with our repo in it)
I'd like to confirm my understanding of how this would occur:
- the Pipelines Docker build environment is pulling our image and (as the build setup process) creating a container from that image and cloning the repo into that container in $BITBUCKET_CLONE_DIR
- the build environment (not our container) is then building (or committing?) the container that now has our repo and pushing it up
options: docker: true
image: name: us.gcr.io/our-project/ourImage:buildTag
username: _json_key
password: '$GCLOUD_API_KEY'
pipelines:
branches:
Production:
- step:
name: Build Production Image
deployment: production
caches: - docker
script:
- docker build -t us.gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:$IMAGE_TAG .
- docker push us.gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:$IMAGE_TAG
I think what I'm confused about is the Dockerfile: am I meant to supply a Dockerfile in that path on my image? Or is docker build not even what I'm after here since I just want to commit the environment as I have it?
Thanks for your help!