tencent-ailab / hok_env

Honor of Kings AI Open Environment of Tencent
https://aiarena.tencent.com/aiarena/en/open-gamecore
Apache License 2.0
590 stars 68 forks source link

`apt install --install-recommends -y winehq-stable` did not complete successfully #48

Closed haopan27 closed 4 months ago

haopan27 commented 4 months ago

I am creating this issue for better visibility, as I already described what it was about in my comment here

I was hoping for a workaround to install winehq on a Centos7 system. Not sure if this is at all possible / anyone has attempted. Any help is much appreciated on this front.

hongyangqin commented 4 months ago

It is ok to use CentOS 7 as the host system and use Ubuntu as the base image of the container. The two do not conflict. Just install Docker to your host system and then build the image without changing the base image in dockerfile.

Please refer to What is a Container? for more details.

haopan27 commented 4 months ago

I have finally sorted out this issue: the images were created without issues.

To wrap up, one has to perform a few changes in order for this to work:

  1. Drop the "=" sign on line 13 in dockerfile.gamecore
  2. Execute the following commands, instead of those suggested in run_windows_gamecore_on_linux, to properly perform a multi-stage build.
base_image=tencentailab/hok_env:cpu_v2.0.1
target_image=final_gamecore
internal_image=gamecore

docker build -f ./dockerfile/dockerfile.gamecore --target gamecore -t ${internal_image} --build-arg BASE_IMAGE=${base_image} .
docker build -f ./dockerfile/dockerfile.gamecore -t ${target_image} --build-arg BASE_IMAGE=${base_image} .
  1. Finally make sure that the docker image name is final_gamecore, as shown below: docker run --network host -e SIMULATOR_USE_WINE=1 -it final_gamecore

What also helped me immensely, was the dockerfile reference, so that I could understand the content inside dockerfile.gamecore.