Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
We can lower the size of the output operator container image if we don't run 'chown' commands in seperate RUN commands inside the Dockerfile, but instead use the '--chown' argument of the COPY command.
Using 'RUN chown...' will copy all the files affected with their whole size to a new layer, duplicating the previous files from the COPY command.
Example:
$ docker image history ghcr.io/apache/flink-kubernetes-operator:ccb10b8
...
<missing> 3 months ago RUN /bin/sh -c chown -R flink:flink $FLINK... 116MB buildkit.dockerfile.v0
...
This would mean a 20% reduction in image size.
Attachments
Issue Links
- links to