otomi-core icon indicating copy to clipboard operation
otomi-core copied to clipboard

Moz/refactor/dockerfiles

Open Morriz opened this issue 3 years ago • 7 comments

splits up dockerfiles and compresses their builds to minimize size:

otomi/core: 1.7Gi before 1.2Gi after

Morriz avatar Jan 04 '22 19:01 Morriz

you may inspect the Dockerfiles? It is not complex. As the description mentions: it saves 500MB size when leaving out unnecesary tools, but it adds this setup to maintain. Will be beneficial when we get traction

Morriz avatar Feb 17 '22 12:02 Morriz

yes, we will do it in this week.

j-zimnowoda avatar May 16 '22 08:05 j-zimnowoda

We should consider using this tool: https://github.com/docker-slim/docker-slim

diabhey avatar May 17 '22 06:05 diabhey

Tnx @diabhey for the suggestions. I rejected them in favor of shellcheck exclusions for our Dockerfile(s). String split should only warn.

Morriz avatar May 17 '22 07:05 Morriz

I prefer not to. I think we should use minimal base images that are secure. We are not in need of creating base images ourselves

On Tue, 17 May 2022 at 08:17, Abhimanyu Selvan @.***> wrote:

We should consider using this tool: https://github.com/docker-slim/docker-slim

— Reply to this email directly, view it on GitHub https://github.com/redkubes/otomi-core/pull/706#issuecomment-1128457251, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHF6KMVPGTGQSQQQNV7E33VKM2XTANCNFSM5LIHYOHA . You are receiving this because you authored the thread.Message ID: @.***>

Morriz avatar May 17 '22 08:05 Morriz

you may inspect the Dockerfiles? It is not complex. As the description mentions: it saves 500MB size when leaving out unnecesary tools, but it adds this setup to maintain. Will be beneficial when we get traction

I inspected them but it is a bit convoluted, because they are released in many places, so it is difficult to grasp an idea and check if order of build pipeline is correct. So far I see that there are four container images now:

  • core
  • base
  • tools
  • cli How do they depend on each other?

Btw, it does not sound like high priority now, doesn't it?

j-zimnowoda avatar May 18 '22 11:05 j-zimnowoda

you may inspect the Dockerfiles? It is not complex. As the description mentions: it saves 500MB size when leaving out unnecesary tools, but it adds this setup to maintain. Will be beneficial when we get traction

I inspected them but it is a bit convoluted, because they are released in many places, so it is difficult to grasp an idea and check if order of build pipeline is correct. So far I see that there are four container images now:

  • core
  • base
  • tools
  • cli How do they depend on each other?

C'mon, those dockerfiles are easy to read. What do you not get? Only core is split to also deliver cli

Btw, it does not sound like high priority now, doesn't it?

Not really, but saving 500Mb is quite a lot, so it would be beneficial for many reasons. Having all nodes pulling the otomi container when assigned a drone runner is costly.

Morriz avatar May 18 '22 11:05 Morriz