Ensure not using the current FROM alias as COPY '--from' value
Copying from container to itself is generally are not common and can ocurred by mistyping or confusing.
Risk Level: medium
Platform: Docker
Spectral Rule ID: DOCKR012
REMEDIATION
Instead of copy file between container and itself, you can use RUN cp
and get the same functionality.
FROM someimage:tag as build
- COPY --from=build /binary /
+ RUN cp /binary /
RUN python main.py
Read more:
Updated about 1 year ago