docker-gitlab icon indicating copy to clipboard operation
docker-gitlab copied to clipboard

Docker Multistage for parallel build

Open th-2021 opened this issue 11 months ago • 3 comments

This PR moves the builds from install.sh into Dockerfile.multistage, allowing for parallel build execution (with docker buildkit).

This changes circleci configuration to use large modell (4 CPU, 15 GB memory). Also buildkit is enabled. This brings down build time to 48 min on circleci.

@sachilles and @kkimurak please review this.

The change is parallel to the existing files: Dockerfile.multistage and install2.sh are used.

th-2021 avatar Jan 10 '25 08:01 th-2021

Ok, it's done to build. It takes about 55m in total (47m to build).

First impression: Is it possible to separate multistage build and circleci config updates?
As far as I read the comments in the PR, I can see that just specifying "resource_class: large" and "use-buildkit: true" to circleci config will reduce the build time to less than an hour (I have never tested so I'll try later by myself..). If that's the case, we should merge this first. If we only need to make a few changes, the review time will be shorter and we will be able to start the release process quickly.

Regarding the multistage build, there are a lot of changes, and another comment https://github.com/sameersbn/docker-gitlab/issues/3042#issuecomment-2580867116 pointed out that the image size has increased, so I think it would be a good idea to take some time to investigate this.

kkimurak avatar Jan 10 '25 09:01 kkimurak

Ok. Build worked within the same time range ~48 min, I'll separate circleci into a new PR.

th-2021 avatar Jan 10 '25 11:01 th-2021

Great!

kkimurak avatar Jan 10 '25 11:01 kkimurak