简体   繁体   中英

How to configure git with docker container for custom code.

Sorry if I sound stupid with my question, I am newbie to docker. For one of my project, our provider has provided their docker images, docker-compose.yml.

In one of the container, there is a directory where we can place our custom files and folders. I would like to understand how can I configure git with this container so that can create branches and commit my code related to custom directory.

Just one more thing if that can be helpful is with custom changes we are not modifying source image and this changes are synced up with the volumes mentioned in yml file. Thanks in advance for your time and help.

I think there's some confusion here. The image you have can be used to test your code by simply mapping the folders.

This means that if your git repository contains your code, you can use a mapping like:

volumes:
    - relative/path/to/my/code:/path/in/image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM