Docker on Render
Docker is the preferred application delivery mechanism for an increasing number of applications. Render offers native support for running containerized apps and services at scale, offering features that were previously available only in complex orchestration tools like Kubernetes.
Render’s Docker support includes:
- Deploying prebuilt images from a container registry
- Automated image builds and deploys from a Dockerfile in your Git repository
- Parallelized multi-stage builds
- Customizable Docker
CMD, context directory, and Dockerfile path
- Automatic translation of environment variables to Docker build args
- Maximal layer caching for faster builds
- Infrastructure as Code with
Docker services also support universal Render features like:
- Setting a pre-deploy command to run database migrations and other tasks before each deploy
- Private networking, load balancing, and service discovery (limited on free instance types)
- Persistent disk storage
- Automatic Brotli and gzip compression for faster responses
- Easy HTTP health checks and zero downtime deploys
- Automatic Pull Request Previews
- Native HTTP/2 support with automatic HTTP → HTTPS redirects
- Unlimited custom domains (25 free per service)
Render has native support for many popular languages, including Node.js, Python, Ruby, Go, Rust, and Elixir. You don’t need to use Docker on Render if your service can be deployed with a native runtime and a build and start command.
You should consider containerizing your application in the following scenarios:
- You need OS-level packages that aren’t included in a native runtime. With Docker you have complete control over your base operating system and installed packages.
- Your application is in a language not yet supported natively on Render, like PHP, Java, or ASP.NET.
- You need guaranteed reproducible builds. We release regular updates to native runtimes to improve functionality, security, and performance. While we aim for full backward compatibility, using a Dockerfile is the best way to ensure that your production runtime is always in sync with your local builds.
Render uses the BuildKit engine to build your Dockerfiles.
Run your local builds with
DOCKER_BUILDKIT=1 docker build to use BuildKit on your own machine.
Render caches all intermediate layers in your Dockerfile, which significantly speeds up subsequent builds. Follow these instructions from Docker to further optimize your images and improve build times.
Render builds your Docker image on every push to your repo, storing the image in a private and secure container registry. After building the image, the system creates new containers based on the latest version of your app and starts directing traffic to them as soon as they are healthy. For more details, see Zero-downtime deploys.
You can build and deploy your own Dockerfile by adding it to your repo and creating a Render service as usual. Render automatically detects Dockerfiles at the root of your repo and suggests a Docker runtime for your app during service creation.
We also have templates to install popular open-source applications on Render using Docker: