I am new to docker(2 days) and really trying to understand how I can integrate it in my development workflow.
Consider this situation (yes, I made this picture)

I am continuously working on my local git repo and want to test my code in one(or more) docker containers.
Question
a.) What is the best way recommended to get the code locally to these containers.
The reason I asked is because if I have to git commit-push locally and pull in respective containers, I see 2 problems upfront with that
1.) The rounds trip time in development is costly
2.) What if I am not in state to check-in my code, I am just testing/reproducing a bug etc.
Pardon my ignorance and please enlighten me with your ideas
Thanks
For (2), that's what Git branches are for. If (1) is really a deal-breaker, and if Docker is running on the same machine that you're doing your development on (it's not clear whether that's the case), you can mount the local directory containing your code into a new Docker container with:
docker run -v /local/path/to/code:/path/inside/container/where/code/will/be --other-options imagename
This way, the directory will exist on both your local machine and in the Docker container at the same time (with changes at either end automatically showing up in the other), and you can operate on the directory's contents directly within Docker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With