CLI Build on Docker

Hi,

I have got quite far in building a web-mobile game with a windows docker container, but the build gets stuck at this stage:

When I run this without a docker container I can pass this stage and when I’m looking at the CLI output I think it gets stuck on build jsb-adapter.

Locally CLI output logs from same place in the build where it passes to the next stages instead of timing out:
image

@jare I’m tagging you because I think you have some nice input here in trying to get me further into the build, cause I’m pretty stuck at this stage.

I’m building on currently latest windows 10 docker container:
mcr.microsoft.com/windows:2004

Any ideas?

Hi, maybe you can refer to this document first.

Creator also needs GUI permission when build with CLI, maybe you need to check if Creator has this GUI permission on docker .

Hi @yufang.wu!

Thank you for your response. I have based my scripts onthis documentation. I can run it locally, but problems are that it gets stuck as the screenshots show in the windows docker container.

If you have any ideas how to get past this step in the build, then please let me know :slight_smile:
Thanks a lot in advance!

Hi @zhiming_wu,

How do I apply these GUI permissions?

To be able to pass the language popup I applied a settings.json with english selected in it into C:\Path_to_user\.CocosCreator\settings.json.

What else do you suggest I need to do? I have read the documentation and also tried with --force, but no luck. Always gets stuck on the same place unfortunately.

Very thankful if you could assist me in getting this working!

Sorry, I have not clear solution, because we have not test on docker yet.

Creator is developed by Electron , maybe you can google the solution, like ‘how electron run on docker’

@zhiming_wu I’ve also tried by installing electron on the environment etc. What I cannot see is at what point of the build process do I get stuck?

Can you somehow check the build process code and locate what part can be causing the timeout at this stage?

The worker stop because the error above (import assets), this error like someone run creator on jenkins without GUI permission .

@zhiming_wu sounds like the same error then. How has that been solved on Jenkins? How do I apply “GUI Permissions”?

@zhiming_wu A bit confused also about the build process for example
C:\CocosCreator\2.3.3\resources\app.asar\editor\share\assets\meta\fbx.js
doesn’t even exist, but when you run the build it somehow does exist during the build. I cannot find a single fbx.js file locally even?

we suggest them use jenkins slave and master mode.

app.asar/xxxx is an encrypt file path , we encrypted the core editor code. so you can not find this file.

I see, makes sense.

I got past this build step by removing
c:\CocosCreator\2.3.3\resources\static\default-assets\model\primitives.fbx
and
c:\CocosCreator\2.3.3\resources\static\default-assets\model\primitives.fbx.meta

But this is not optimal of course, just trying to understand why it cannot continue the build process.
After that it continues until:
image

But of course I want to get it to work without removing some of Cocos Creator engine files :slight_smile:

At this stage it has not yet build the game. This is what it has done:
image

worker is an electron window, and if Creator have not GUI permission,Creator can not open the window , and it cannot continue build project too, we will try to reload worker after 10s if the worker window is not open correctly.

Thanks for your input @zhiming_wu!

When I run it locally I can build the game without any window opening, it just runs in the terminal nicely and gets the job done. I’ve realized that it wants to open the language selection dialog if you haven’t setup settings.json file with a language selection, but other than that I don’t know why it needs to open the editor, since it builds fine for me locally.

Am I missing a config or something to have it build without opening the editor itself?

When you build with command line, Creator will open too, we open an invisible window, Creator can not build the project without electron now. Because creator needs load plugins event if build with command, so Creator needs GUI permission to allow it open Electron window.

Are in Creator’s plans change this? To work windowless? Like in 3.0 or so? For those who want CD/CI it would be amazing.

Linux releases for those ends too :laughing:

Maybe not, it’s hard to use windowless because many plugins use electron ipc message to communicate each other.

:cry:

(we don’t have this reaction, so I’m replying it)

@zhiming_wu @Randomzord

Wonder if we together with Cocos Creator team could figure out a way to create a Docker container (linux if possible) to build the game with. I’ve seen some older threads where people have succeeded to build it on top of linux. I’m unsure how exactly, but if it has been done it is probably possible.

I think cocos creator could benefit from this hugely and would probably not be too big of a task compared to all the benefits for the entire community!

What do you think? I’m happy to help!