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:
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:
After you update the Dockerfile in your repository, your Docker app automatically redeploys on App Platform.