Support Forums

Can we use our Dockerfile to build an image and deploy it in netlify

Can we use our Dockerfile to build an image and deploy it in netlify? Is this possible?. If its so please provide the steps.

Hi, @ashar.ma. It depends on what you mean by “image”.

If “image” means a virtual machine image (a docker container), then this isn’t possible at Netlify. Netlify is designed to deploy static files and doesn’t provide any ability to run programs/apps with the exception of serverless Functions. So, if you are looking for a way to run your Docker container at Netlify, that isn’t possible.

Now, if instead by “image” you mean that you run your Docker container locally to generate a site build of static files to deploy, then yes that is possible. You can build your site anywhere and then deploy that build to Netlify using the manual deploy command of the Netlify CLI tool.

The CLI tool is designed to be used with third-party CI/CD systems. It can easily be invoked by scripts or other applications.

If there are other questions or if this answer isn’t clear, please reply anytime.


Thanks for your reply.

Is there any CLI tool will you suggest to build a docker image and deploy to netlify?

Hi, @ashar.ma. Again, you cannot deploy a docker image to Netlify. The follow support guide should explain why: