This docker image was built to facilitate the development of scripted bots and research using the s2client-proto.
This docker image have one tag for each one version listed in Linux Packages. You can see all tags here.
Example: if you want to take the version 4.9.3, you need to specify this version in the docker pull command:
docker pull alvarofpp/s2client:4.9.3.
The latest is the same image of the 4.10, because it's the latest version until this moment.
If you use the latest version, you can ignore the :<version> in these commands below.
These instructions will cover usage information and for the docker container.
In order to run this container you'll need docker installed.
Docker pull command:
docker pull alvarofpp/s2client:<version>And run the client:
docker run --rm alvarofpp/s2client:<version> run_clientRun your client in a specific port:
docker run --rm --env CLIENT_PORT=13000 alvarofpp/s2client:<version> run_clientCLIENT_PORT- The port the client runs on. By default is12000.
This image already comes with the all maps listed in Map Packs and the pysc2's minigames (version 1.2). But if you need add more maps or minigames, you can through the command:
docker cp <map_folder> <container_id>:/root/StarCraftII/Maps/All maps and minigames downloaded for the image are listed in image/maps.txt.
Using Docker's multi-stage, you can copy the StarCraft 2 files and use it in your own Docker image.
FROM alvarofpp/s2client:4.10 AS sc2client
FROM python:3.9.10
# ...
COPY --from=sc2client /root/StarCraftII /root/StarCraftIIIf you want to display graphics during the script execution, you can follow the steps below.
docker run -i -t -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro alvarofpp/s2client:<version>Description:
-i: sets up an interactive session;-t: allocates a pseudo tty;-e: sets the host display to the local machines display (which will usually be:0);-v: bind mounts theX11socket residing in/tmp/.X11-unixon your
local machine into/tmp/.X11-unixin the container and:romakes the socket read only.
In your local machine:
xhost +
# access control disabled, clients can connect from any host
xhost
# access control disabled, clients can connect from any host
# SI:localuser:usernameSave the last line of the xhost result (in this example it's SI:localuser:username)
for use in the next step.
In your docker container:
xhost +si:localuser:username
# localuser:username being added to access control listDone! After that, you can run your script.
Reference here.
Contributions are more than welcome. Fork, improve and make a pull request. For bugs, ideas for improvement or other, please create an issue.
This project is licensed under the MIT License - see the LICENSE file for details. If you use this docker image, you also agree to AI and Machine Learning License.