flowchart TB
subgraph build["Building the image"]
user["USER 20500:20500"]
chown["chown at build time
or COPY --chown"]
end
subgraph image["Shipped image"]
decl["Declaration
Config.User"]
proprio[("File owner
baked into the layers")]
end
subgraph exec["Run time"]
q{"does docker run
pass --user ?"}
impose["uid from the
command line"]
herite["uid declared
by the image"]:::accent
end
ecrit["The application writes"]:::accent
refus["Permission denied"]:::danger
user ==> decl
chown ==> proprio
decl ==> q
q ==>|no| herite
q -.->|yes| impose
proprio ==> ecrit
herite ==> ecrit
impose -.-> ecrit
decl -.->|owner left as root| refus