I'm trying to debug bitbucket pipelines locally on my machine(Windows 10, Hyper-V). I followed the tutorial https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html. However, when I mount the volume on the container, there are no folders in it, it is empty.
I'm running this command :
Can anyone please suggest what should be done. It will be helpful. Thank You!
Hi,
Can you verify the *full path* for the volume mounting? Is the full path actually "/host_mntC/z_copied" or is it a subdirectory of other directories?
From the docker CLI documentation:
When the host directory of a bind-mounted volume doesn’t exist, Docker will automatically create this directory on the host for you. In the example above, Docker will create the
/doesnt/exist
folder before starting your container.
https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only
This seems to be consistent with the behaviour you're seeing.
Thanks,
Phil
Hi TV,
Did you try to set up a Dockerfile to run into your container?
I'm asking this because, you may be able to set up a Docker File that runs your scripts that, for example:
1) Clone your repository
2) Run your builds/tests
You can also take a look on this Docker documentation that has some good tips on how to achieve it:
https://docs.docker.com/engine/reference/commandline/build/#examples
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabriel,
Yes, I have a Dockerfile. I can run the builds in it. But when I mount the volume in the container for the image it doesn't have any file in it.
Can you suggest anything please.
Thank You!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi TV,
I think that you can add something like this to your Dockerfile (before the Build step):
FROM ubuntu
ADD .ssh /root/.ssh // For the private and public key
RUN mkdir /usr/… // For copying the known_hosts file
ADD known_hosts /usr/… // Copy the known_hosts file.
RUN mkdir /opt/myservice/code_to_be_synced
RUN cd /opt/myservice/code_to_be_synced
RUN git clone username@gitrepo // This is to clone the code base
These steps add an SSH key to your container and, clone your repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.