Looks like dockerfile command chown & chmod
creates new layer in size of gitea binary that makes image close to twice as big.
see: https://github.com/go-gitea/gitea/blob/master/Dockerfile.rootless#L54
and: https://hub.docker.com/layers/gitea/gitea/latest-rootless/images/sha256-b55c30e134a5ce42aaf3cb94402c3ac98294ffbbb82ea1a70e9c669a586b0441?context=explore
Maybe file could be chown'ed and chmod'ed before building docker image?
ping @sapk
There's a --squash
flag on docker build
to merge layers but it's been considered experimental for years. Interestingly, it seems not experimental on docker buildx
.
Every RUN
generally creates a layer so if you want minimum size, either use a single chained RUN
or --squash
.
yes but that will squash all layers that is not so good as base layers are not reused anymore
btw why linux-amd64|linux-arm64 tags are needed when there is already tag that has both archs in it?
btw why linux-amd64|linux-arm64 tags are needed when there is already tag that has both archs in it?
@lafriks docker manifest needs images to already exist
oh, ok
Should probably switch to docker buildx
for cross-platform builds at some point.
https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408
Most helpful comment
Should probably switch to
docker buildx
for cross-platform builds at some point.https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408