Both approaches are not very good to be honest. Local construction is not the best way to build everything you want to have in production. You may have local packages that may be relevant to what you are building. The same applies to the OS on which you are doing this.
. "", . , , .
, CI/CD. , . , , "desing" - , , .
, ( ), CI/CD , shell script Docker , . CI/CD, .