Question

How to create docker image using already configured application folder

My basic requirement is to create a docker image and deploy it to docker registry.

I have a pre-configured application folder(/home/myfolder) in my jenkins server(to do this configuration I have used ansible script). Then I need to create docker image from that folder and deploy it to docker registry.

What’s the best way to do this? Please help me with this as I’m new to docker.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I suggest that you create a Dockerfile inside that directory and install docker-compose. That way you will be able to create your own image and after that login to the container which should have everything you need. This is a basic start. I do warn you however that you have to pay attention because dockerfile build sometimes likes to disperse files and folders differently unlike in your real setup.

This link should shed some light for you: https://docs.docker.com/compose/gettingstarted/

If you have any other question please write it down. I will be happy to answer what I know.