Docker image build is 3 times slower than the normal build

I’ve received a response from them. They recommended using machine executors. As mentioned by @eliasdorneles the problem persists even with machine executors.
This is what I’ve tried:
Comparison of build time (the npm run build command):

Docker executor: 14783ms + 21555ms = 36338ms (36.33 seconds in total)
Machine executor-docker build command: 25194ms + 42171ms = 67365ms (67.365 seconds in total)
Machine executor-docker run command: 25188ms + 43326ms = 68514ms (68.514 seconds in total)

Edit:
Added config.yml