Why am I receiving a "user does not exist" error when building my Docker app on App Platform?

Validated on 10 Jul 2024 • Last edited on 17 Apr 2025

If your Docker App on App Platform fails to build with the following error in the deployment logs, then the USER instruction may be in the wrong place in your Dockerfile:

error building image: error building stage: failed to execute command: identifying uid and gid for user app: user app is not a uid and does not exist on the system

In a Dockerfile, each instruction builds on the state created by the previous instructions. If the USER instruction is before a FROM or WORKDIR instruction, the FROM and WORKDIR instruction fail to execute because the user ID doesn’t exist in the base image or work directory yet.

To fix this, make sure the line with the USER instruction is after the lines with the FROM and WORKDIR instructions in your Dockerfile:

Dockerfile
FROM example-image:latest AS base
WORKDIR /example/dir
USER example-user
EXPOSE 80

After you update the Dockerfile in your repository, your Docker app automatically redeploys on App Platform.

Why am I receiving an "invalid dockerfile_path" error when building my Docker app on App Platform?

Ensure your Dockerfile’s path is correctly defined using the dockerfile_path parameter in your app spec file.

How do I generate my app's SSL certificate?

App Platform automatically generates and issues the SSL certificate during the configuration.

Why am I receiving 520 status codes from my app?

Your app may have crashed while trying to receive an upload or return a response larger than it has been configured to manage.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.