Hello,
I have a repository that has 2 directories inside it. These 2 directories represent 2 separate docker projects.
Now with the bitbucket pipeline, I am trying to build the images but the build fails because Docker build context is not able to locate the files required for the build.
example:
pipelines:
default:
- parallel:
- step:
script:
- docker build ${BITBUCKET_CLONE_DIR}/directory_1 --tag ${IMAGE_NAME}
# Dockerfile
# set base image (host OS)
FROM python:3.8
# set the working directory in the container
WORKDIR /code
# copy the dependencies file to the working directory
COPY requirements.txt . ----- fails at this step
# install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# copy the content of the local src directory to the working directory
COPY src/ .
# command to run on container
CMD [ "python", "./trsync.py" ]
Error:
COPY failed: stat /var/lib/docker/165536.165536/tmp/docker-builder235206778/requirements.txt: no such file or directory
I know this will work if I put the 2 docker projects in 2 different repo and keep the Dockerfile in repository root.
Thanks,
Amit