Deploy Ghost custom build via CI/CD pipelines in production

Hi,

I forked the latest Ghost v5.118.1(GitHub - TryGhost/Ghost at v5.118.1) and make some server side changes to the core. I am able to create a dev build and run it locally but I failed to create a production build using an Ubuntu based docker image. (Running yarn dev also failed when run on an Ubuntu based docker image)

The image config are as follows:
Ubuntu v20
Node v20.14.0
Yarn v1.22.22

Tried yarn setup and yarn archive as mentioned in the official documentation but the yarn archive step fails with the following error:

nx run @tryghost/post-revisions:“build:ts”

$ tsc

 > nx run ghost:"build:assets"

                              Error: Operation not permitted (os error 1)
                                                                             at PseudoTerminal.fork (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/pseudo-terminal.js:42:73)
                                                     at ForkedProcessTaskRunner.forkProcessWithPseudoTerminal (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:141:45)
                                                                           at ForkedProcessTaskRunner.forkProcess (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:127:25)
                                                                               at TaskOrchestrator.runTaskInForkedProcess (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/task-orchestrator.js:304:54)
                                                                              at TaskOrchestrator.applyFromCacheOrRunTask (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/task-orchestrator.js:287:61)
                                                                              at async TaskOrchestrator.executeNextBatchOfTasksUsingTaskSchedule (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/task-orchestrator.js:85:13)
                                                                                                    at async Promise.all (index 3)
                                                                                                                                      at async TaskOrchestrator.run (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/task-orchestrator.js:61:9)
                                                                                                                      at async defaultTasksRunner (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/default-tasks-runner.js:51:16)
                                                                                                        at async invokeTasksRunner (/opt/maglev/dnapulse/dist/node_modules/nx/src/tasks-runner/run-command.js:441:5) {
                                                                                code: 'GenericFailure'
                                                                                                      }

                                                                                                       > nx run @tryghost/stats:build  

Also, would appreciate if anyone can suggest some other way to create a custom production build (with the ghost>core changes intact) that does NOT involve creating a tar or the ghost-cli installation?