harbor/make/photon
Mitsuru Kariya 02d042a6b9
Reduce image size
Do following actions to reduce the size of the generated images.

- Change `COPY` command + `chown`/`chmod` command to `COPY` command +
  `--chown`/`--chmod` option.
  To prevent both files before/after `chown`/`chmod` commands from being
  recorded on different layers.
- Put all `tdnf` commands in a single `RUN` command and move `tdnf clean all`
  command to the end.
  To prevent the `tdnf` cache from being recorded on a layer, and the `tdnf`
  database from being recorded on multiple layers.
- Add `--link` option to `COPY` command.
  This does not contribute to image size reduction, but makes image building
  more efficient.
- Move `chown /etc/pki/tls/certs` to the `Dockerfile.base`.
  This does not contribute to image size reduction, but is used in
  conjunction with `COPY --link` to make image building more efficient.

The target images and their sizes are as follows. (The sizes are the value
when built locally)

- harbor-core : 185MB -> 118MB
- harbor-db : 285MB -> 263MB
- harbor-exporter : 108MB -> 79.1MB
- harbor-jobservice : 159MB -> 105MB
- harbor-registryctl : 160MB -> 104MB
- redis-photon : 179MB -> 170 MB
- standalone-db-migrator : 328MB -> 284MB

Note that harbor-log, harbor-portal, and nginx-photon have almost no effect,
and prepare is not directly executed by the user, so they are not included.

Also, registry-photon and trivy-adapter-photon are not included, since
PR#20622 and PR#20623 include equivalent action for these two, respectively.

Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>
2024-06-21 02:08:34 +09:00
..
common Replace tilde in install_cert.sh 2020-12-21 20:39:34 +08:00
core Reduce image size 2024-06-21 02:08:34 +09:00
db Reduce image size 2024-06-21 02:08:34 +09:00
exporter Reduce image size 2024-06-21 02:08:34 +09:00
jobservice Reduce image size 2024-06-21 02:08:34 +09:00
log Bump up photon version from 4.0 to 5.0 (#19006) 2023-08-01 11:52:33 +08:00
nginx Bump up photon version from 4.0 to 5.0 (#19006) 2023-08-01 11:52:33 +08:00
portal Bump up photon version from 4.0 to 5.0 (#19006) 2023-08-01 11:52:33 +08:00
prepare add prepare migration script for 2.11.0 (#20315) 2024-04-22 16:34:08 +08:00
redis Reduce image size 2024-06-21 02:08:34 +09:00
registry bump golang 1.22.3 (#20433) 2024-05-16 14:32:59 +08:00
registryctl Reduce image size 2024-06-21 02:08:34 +09:00
standalone-db-migrator Reduce image size 2024-06-21 02:08:34 +09:00
trivy-adapter bump golang 1.22.3 (#20433) 2024-05-16 14:32:59 +08:00
Makefile remove the notary from backend (#18668) 2023-05-18 18:47:42 +08:00