Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-34439

Move chown operations to COPY commands in Dockerfile

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              mateczagany Mate Czagany
              mateczagany Mate Czagany
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: