Reason i am asking is i want to build some docker images which are not suitable on arm right now .. so i am just wondering If i run terminal on rossetta2 and build docker images. Those images will be built on rossetta2 ?
No, code execution doesn’t work that way on macOS Big Sur.
Rosetta2 automatically translates the app when you install it from an Apple install package or translates on the fly if you otherwise side-load the executable and library code.
It doesn’t virtualize a system - it translates code.
Things like kernel extensions or scripts can not be translated and will fail outright. App developers must make new versions of those extensions and scripts in that case.
The only thing running terminal in Rosetta2 will accomplish is you use the translated M1 instructions and not the optimized ones for the terminal app itself. The shell and things running inside terminal run the same either way.