Dockerfile
:
FROM node:18-alpine AS a
RUN echo a > a && chown node: a
USER node
FROM node:18-alpine
COPY --from=a /a /a
RUN cat a
$ docker build -f Dockerfile4 .
...
Step 6/6 : RUN cat a
---> Running in 973e91763867
a
Removing intermediate container 973e91763867
---> 71a91bf5b1b9
Successfully built 71a91bf5b1b9