When building your Docker app on App Platform, an Invalid dockerfile_path, no such file exists in the git repository
error occurs when your dockerfile_path
is not correctly defined in your Application Specification (app spec) file.
By default, the dockerfile_path
value is set to the file Dockerfile
in the root of the repository:
name: sample-dockerfile
services:
- name: web
git:
repo_clone_url: https://github.com/digitalocean/sample-dockerfile.git
branch: main
dockerfile_path: Dockerfile
If your Dockerfile is located in a specific directory in your repository, update your app spec to use your Dockerfile’s exact location as the dockerfile_path
value. To update your app spec, in the DigitalOcean Control Panel, select the app you want to update its app spec for, then click the Settings tab. In the App Spec section, click Edit, then update the app spec in the control panel:
name: sample-dockerfile
services:
- name: web
git:
repo_clone_url: https://github.com/digitalocean/sample-dockerfile.git
branch: main
dockerfile_path: <your-folder>/Dockerfile
After you’ve added the correct path to your dockerfile_path
parameter, click Save to update the app spec which automatically redeploys your Docker app.