├── .gitignore ├── README.md ├── all.sh ├── build ├── .gitignore ├── Dockerfile ├── all.sh ├── api-all.sh ├── api-build.sh ├── api-copy.sh ├── api-package.sh ├── build-copy.sh ├── clone.sh └── make-container.sh ├── config.sh ├── dev ├── Dockerfile ├── README.md ├── all.sh ├── attach-user.sh ├── commit-container.sh ├── make-container.sh ├── run-dev.sh └── run-user.sh ├── docker-cleanup.sh ├── game ├── Dockerfile ├── all.sh ├── download.sh ├── make-container.sh ├── run-interactive.sh ├── run-tests.sh ├── run.sh └── unpack.sh └── replays └── add-replays.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *.pyc 4 | downloads 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # s2client-docker 2 | 3 | A docker image for building and running the StarCraft II API on Linux 4 | 5 | This is a work in progress. Contributions welcome! 6 | 7 | TODO: 8 | * [ ] Get unit tests working on s2client-game container 9 | * [ ] Automate the replay & Battle.net Cache population 10 | * [ ] Create a combined container for developers (with git, API and game) 11 | * [ ] Get some compose / swarm examples for doing larger training exercises 12 | 13 | # Summary 14 | 15 | By downloading and running this you are agreeing to: 16 | 17 | [StarCraft II AI and Machine Learning License](https://github.com/Blizzard/s2client-proto/blob/dca8b6831a84747c2cd6e0c33d6416e14838d886/DATA_LICENSE) 18 | 19 | 20 | # Building Containers 21 | 22 | 1. Building the game container 23 | 24 | ~~~ 25 | cd game && ./all.sh 26 | ~~~ 27 | 28 | This creates a new container named s2client-api. 29 | 30 | The entrypoint will be the StarCraft II executable listening for API calls on port 12000. 31 | 32 | You can run the game now as a container: 33 | 34 | ~~~ 35 | docker run -P -d s2client-game 36 | ~~~ 37 | 38 | TODO: There appears to be an issue connecting on the exposed port 39 | 40 | 3. Building the API build container 41 | 42 | ~~~ 43 | cd build && ./all.sh 44 | ~~~ 45 | 46 | This builds the API and puts binary artifacts into the build volume. 47 | 48 | 4. Test the containers 49 | 50 | ~~~ 51 | cd game && ./run-tests.sh 52 | ~~~ 53 | 54 | TODO: This currently crashes 55 | 56 | 57 | 2. Installing replay packs and the Battle.net cache to run hem 58 | 59 | ~~~ 60 | ~~~ 61 | 62 | TODO: Consider using volumes for this case as well, lots of data to move around. 63 | 64 | ### Running the API build 65 | 66 | 67 | You can run the build yourself inside the s2client-api container: 68 | 69 | ~~~ 70 | docker run -it s2client-api 71 | ./api-build.sh 72 | ~~~ 73 | 74 | 75 | ### Running the Game 76 | 77 | ~~~ 78 | docker run -d s2client-game 79 | ~~~ 80 | 81 | If you want to use the replay container automation you should export 82 | the container ID in an environment variable. 83 | 84 | ~~~ 85 | export GAME_CONTAINER=`docker run -P -d s2client-game` 86 | ~~~ 87 | 88 | ### Developing using the API 89 | 90 | ~~~ 91 | cd dev && ./all.sh 92 | docker run -it s2client-dev 93 | ~~~ 94 | 95 | The developer image s2client-dev is derived from s2client-game. You will need 96 | to first build the s2client-game image. Running the developer image you can 97 | clone the git repo, update your git config and test against the packaged client. 98 | -------------------------------------------------------------------------------- /all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Build all containers with one command, intentionally omitting 'dev' 5 | # 6 | CONTAINER_LIST="build game" 7 | for CONTAINER in $CONTAINER_LIST; do 8 | echo ====== Running all steps for container: $CONTAINER 9 | pushd $CONTAINER 10 | ./all.sh 11 | popd 12 | echo ====== Finished all steps for container: $CONTAINER 13 | done 14 | 15 | echo COMPLETED build of $CONTAINER_LIST 16 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | api-config.sh 2 | -------------------------------------------------------------------------------- /build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER jrepp@blizzard.com 3 | 4 | # Update the image with required build packages 5 | RUN \ 6 | sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ 7 | apt-get update && \ 8 | apt-get -y upgrade && \ 9 | apt-get install -y \ 10 | net-tools \ 11 | build-essential \ 12 | clang \ 13 | cmake \ 14 | curl \ 15 | git \ 16 | htop \ 17 | libidn11 \ 18 | libz-dev \ 19 | libssl-dev \ 20 | make \ 21 | python-minimal \ 22 | software-properties-common \ 23 | unzip \ 24 | vim \ 25 | wget 26 | 27 | # Add the code 28 | WORKDIR /s2client-api 29 | ADD downloads/s2client-api . 30 | ADD api-*.sh /s2client-api/ 31 | 32 | ENTRYPOINT [ "/bin/bash" ] 33 | -------------------------------------------------------------------------------- /build/all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Clones the git repo, makes the build container, builds the API and copies the 4 | # artifacts to the build volume 5 | ./clone.sh && ./make-container.sh && ./build-copy.sh 6 | -------------------------------------------------------------------------------- /build/api-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ./api-build.sh && ./api-package.sh && ./api-copy.sh 4 | -------------------------------------------------------------------------------- /build/api-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is intended to be embedded in the build container for 4 | # automating the CMake / GNU make build process 5 | 6 | mkdir -p build 7 | pushd build 8 | cmake -G "Unix Makefiles" .. 9 | make -j8 all 10 | popd 11 | -------------------------------------------------------------------------------- /build/api-copy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "Copying built artifacts into /build" 3 | ls /s2client-api/s2client-api-* 4 | cp /s2client-api/s2client-api-* /build/ 5 | -------------------------------------------------------------------------------- /build/api-package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . api-config.sh 4 | 5 | PACKAGE=s2client-api-${GAME_VERSION}.tgz 6 | 7 | echo "====================================" 8 | echo "Building package ${PACKAGE}" 9 | 10 | rm -f ${PACKAGE}* 11 | 12 | pushd build/bin 13 | tar -zcvf ../../${PACKAGE} * 14 | popd 15 | md5sum ${PACKAGE} > ${PACKAGE}.md5sum 16 | cat ${PACKAGE}.md5sum 17 | echo "====================================" 18 | -------------------------------------------------------------------------------- /build/build-copy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_PATH=${0%/*} 4 | . ${SCRIPT_PATH}/../config.sh 5 | 6 | # Build the API artifacts in the build folder 7 | docker run -it -v build:/build --entrypoint="/s2client-api/api-all.sh" s2client-api 8 | -------------------------------------------------------------------------------- /build/clone.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # This clones a clean copy of the repo 5 | # 6 | mkdir -p downloads 7 | 8 | pushd downloads 9 | 10 | if [ -d s2client-api ]; then 11 | cd s2client-api && git pull -r 12 | else 13 | git clone --recursive https://github.com/Blizzard/s2client-api 14 | fi 15 | 16 | popd 17 | -------------------------------------------------------------------------------- /build/make-container.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This builds the container for building the API code 4 | IMAGE_NAME=s2client-api 5 | SCRIPT_PATH=${0%/*} 6 | 7 | echo Copying config.sh for current version 8 | cp ${SCRIPT_PATH}/../config.sh ${SCRIPT_PATH}/api-config.sh 9 | 10 | echo ${IMAGE_NAME} docker image building using ${SCRIPT_PATH}/Dockerfile 11 | docker build ${SCRIPT_PATH} -t ${IMAGE_NAME} 12 | -------------------------------------------------------------------------------- /config.sh: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Common variables used by scripts for building and controlling 4 | # containers 5 | # 6 | GAME_VERSION=3.16.1 7 | 8 | # 9 | # Common command replacements 10 | # 11 | UNZIP_CMD="unzip -Piagreetotheeula" 12 | -------------------------------------------------------------------------------- /dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM s2client-game 2 | MAINTAINER jrepp@blizzard.com 3 | 4 | # Update the image with required build packages 5 | RUN \ 6 | sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ 7 | apt-get update && \ 8 | apt-get -y upgrade && \ 9 | apt-get install -y \ 10 | net-tools \ 11 | build-essential \ 12 | clang \ 13 | cmake \ 14 | curl \ 15 | git \ 16 | htop \ 17 | libidn11 \ 18 | libz-dev \ 19 | libssl-dev \ 20 | make \ 21 | python-minimal \ 22 | software-properties-common \ 23 | unzip \ 24 | vim \ 25 | wget 26 | 27 | ARG SYSTEM_USER_NAME=gituser 28 | ARG GIT_USER_NAME="Git User" 29 | ARG GIT_EMAIL=user@example.com 30 | 31 | # Create the new git user 32 | RUN useradd -ms /bin/bash $SYSTEM_USER_NAME 33 | 34 | # Change the game folder ownership 35 | RUN chown -R $SYSTEM_USER_NAME:$SYSTEM_USER_NAME /SC2 36 | 37 | # Setup the git commit environment 38 | USER $SYSTEM_USER_NAME 39 | RUN git config --global user.name "$GIT_USER_NAME" 40 | RUN git config --global user.email "$GIT_EMAIL" 41 | 42 | # Generate a new SSH key pair without user input 43 | RUN cat /dev/zero | ssh-keygen -q -N "" > /dev/null 44 | 45 | # Set the starting directory 46 | WORKDIR /home/$SYSTEM_USER_NAME 47 | 48 | # Override the s2client-game entrypoint 49 | ENTRYPOINT [ "/bin/bash" ] 50 | -------------------------------------------------------------------------------- /dev/README.md: -------------------------------------------------------------------------------- 1 | # Setting up your development environment 2 | 3 | The developer container is a combination of s2client-game and s2client-api. 4 | 5 | The API code has been omitted because it's assumed you will be cloning the repo 6 | and working with GIT to manipuate the API code. 7 | 8 | This container will copy your git configuration and system username to the 9 | development container. If you want to override this process see below. 10 | 11 | To get setup for developing API code on linux: 12 | 13 | ~~~ 14 | ./all.sh 15 | ~~~ 16 | 17 | You will see your github.com public key as the last step of the build process: 18 | 19 | ~~~ 20 | ... 21 | Successfully built 11c71c8b3a9b 22 | ==== Your github.com SSH public key for the container is: 23 | ssh-rsa XXXXXXXXXXXX2EAAAADAQABAAABAQDf1N64V0NHQEcat3oiE+gTU/q7VPpXvJztRtaQ0X0/rHqGohFI+RVTCAGTsUyzNeVxJDuiPMhV/j9X1rqVV73pcLyM7flgYnriroo19Y3S9np4dPgyR+IeSztBhfCaLSmrVhvscIUlFCcXM8o1mgy8/mUSn5UJJxBdGdRfRt8TrWT7WVnbkLKNv6xUoBWssSNJds6itD/qBjEkZfD4BCP3dXEJL6U6y+HYnIGqv3lByxHhLK+dJ5pU2lGtyypj1/0IsWQVW4F6EaEBtyEy8cOmh17j9FusfhJkply2Xf2q81jm6nHRNsfd1thOAFe2quc0cTfZzX4ZqC9RE9gxwXI/ jrepp@8089fe031125 24 | ~~~ 25 | 26 | You should copy the ssh-rsa .. user@container_id into your github.com settings under the section for SSH keys. 27 | 28 | 29 | To run the developer container: 30 | ~~~ 31 | ./run.sh 32 | ~~~ 33 | 34 | If you want to configure the container by hand see the docker commands in **./make-container.sh** for the --build-arg overrides needed to setup your git account without a working shell. 35 | 36 | 37 | # Using the development environment 38 | 39 | Once your ssh key is imported to github.com you're ready to start working with the API: 40 | 41 | Clone the repository: 42 | ~~~ 43 | git clone git@github.com:Blizzard/s2client-api.git 44 | ~~~ 45 | 46 | Generate the project build files: 47 | ~~~ 48 | cd ~/s2client-api 49 | mkdir -p build 50 | cd build && cmake -G "Unix Makefiles" .. 51 | ~~~ 52 | 53 | # To save your work between sessions 54 | 55 | Now that you've gotten your container up and running you will want to snapshot your changes: 56 | ~~~ 57 | ./commit-container.sh 58 | ~~~ 59 | 60 | If you want to move files out of your container consider cloning into a volume mount (e.g.: /code): 61 | ~~~ 62 | docker run -v code:/code -it s2client-username 63 | ~~~ 64 | 65 | Alternative you can copy the files out using 'docker cp': 66 | ~~~ 67 | .. run your container 68 | export DEV_CONTAINER=`docker ps -l -q` 69 | docker cp $DEV_CONTAINER:/home/username/myfile.txt . 70 | ~~~ 71 | 72 | # Resuming or attaching 73 | 74 | To resume your work after **./commit-container.sh**: 75 | 76 | ~~~ 77 | ./run-user.sh 78 | ~~~ 79 | 80 | 81 | To attach an additional TTY to a running container: 82 | ~~~ 83 | ./attach-user.sh 84 | ~~~ 85 | 86 | # Additional Notes 87 | 88 | The game executable will be located in: 89 | 90 | **/SC2/${GAME_VERSION}/StarCraftII/Versions/Base${BUILD_VERSION}/SC2_x64 91 | -------------------------------------------------------------------------------- /dev/all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Not too much to do here, just here for consistency 4 | ./make-container.sh 5 | -------------------------------------------------------------------------------- /dev/attach-user.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This attaches a shell the last user dev container ID 4 | docker exec -it `docker ps -l -q` /bin/bash 5 | -------------------------------------------------------------------------------- /dev/commit-container.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # This commits the last run container (dev) as with the system user 5 | # as a tag. 6 | # 7 | 8 | SYSTEM_USER_NAME=`whoami` 9 | LAST_CONTAINER_ID=`docker ps -q -l` 10 | CONTAINER_NAME=s2client-${SYSTEM_USER_NAME} 11 | 12 | echo "Committing last container ${LAST_CONTAINER_ID} as ${CONTAINER_NAME}" 13 | docker commit ${LAST_CONTAINER_ID} ${CONTAINER_NAME} 14 | -------------------------------------------------------------------------------- /dev/make-container.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This builds the container that could be used to clone the API and work on 4 | # local changes 5 | IMAGE_NAME=s2client-dev 6 | SCRIPT_PATH=${0%/*} 7 | 8 | # Get the current git user to intantiate in the container 9 | SYSTEM_USER_NAME=`whoami` 10 | GIT_USER_NAME=`git config --get user.name` 11 | GIT_EMAIL=`git config --get user.email` 12 | 13 | echo ${IMAGE_NAME} docker image building using ${SCRIPT_PATH}/Dockerfile 14 | echo Configuring for GIT user: $SYSTEM_USER_NAME, name: ${GIT_USER_NAME}, email: ${GIT_EMAIL} 15 | 16 | docker build ${SCRIPT_PATH} \ 17 | --build-arg SYSTEM_USER_NAME=${SYSTEM_USER_NAME} \ 18 | --build-arg GIT_USER_NAME="${GIT_USER_NAME}" \ 19 | --build-arg GIT_EMAIL="${GIT_EMAIL}" \ 20 | -t ${IMAGE_NAME} 21 | 22 | echo ==== Code mount created at /code in the container 23 | echo ==== Your github.com SSH public key for the container is: 24 | 25 | # Output the key for usage on github.com 26 | docker run -t ${IMAGE_NAME}:latest -c "/bin/cat /home/${SYSTEM_USER_NAME}/.ssh/id_rsa.pub" 27 | -------------------------------------------------------------------------------- /dev/run-dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker run \ 4 | -v code:/code \ 5 | -v build:/build \ 6 | -it s2client-dev 7 | -------------------------------------------------------------------------------- /dev/run-user.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This runs the user dev container 4 | docker run \ 5 | -v code:/code \ 6 | -v build:/build \ 7 | -it s2client-`whoami` 8 | -------------------------------------------------------------------------------- /docker-cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # This cleans up runtime images that have exited and prevents accumulating 5 | # a lot of docker image bloat on your local system 6 | # 7 | docker rm $(docker ps -qaf status=exited) 8 | -------------------------------------------------------------------------------- /game/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER jrepp@blizzard.com 3 | 4 | # Update the image with required build packages 5 | RUN \ 6 | sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ 7 | apt-get update && \ 8 | apt-get -y upgrade && \ 9 | apt-get install -y \ 10 | net-tools \ 11 | htop \ 12 | python-minimal \ 13 | software-properties-common 14 | 15 | # Please run ./download.sh && ./unpack.sh before running this Dockerfile 16 | # Add the 3.16.1 17 | WORKDIR /SC2/3.16.1 18 | ADD downloads/3.16.1 . 19 | 20 | # Expose the API listen port 21 | EXPOSE 12000 22 | 23 | # Start SC2 with API listen port 24 | ENTRYPOINT [ "/SC2/3.16.1/StarCraftII/Versions/Base55958/SC2_x64", \ 25 | "-listen", \ 26 | "0.0.0.0", \ 27 | "-port", \ 28 | "12000" ] 29 | -------------------------------------------------------------------------------- /game/all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ./download.sh && ./unpack.sh && ./make-container.sh 4 | -------------------------------------------------------------------------------- /game/download.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_PATH=${0%/*} 4 | . ${SCRIPT_PATH}/../config.sh 5 | 6 | WGET_CMD="wget --timestamping --continue" 7 | 8 | # 9 | # This downloads zip files for current version 10 | # 11 | mkdir -p downloads/ 12 | 13 | pushd downloads 14 | 15 | # Just clone the base repository for the maps 16 | if [ ! -d s2client-api ]; then 17 | git clone --recursive git@github.com:Blizzard/s2client-api.git 18 | else 19 | pushd s2client-api 20 | git pull -r 21 | popd 22 | fi 23 | 24 | ${WGET_CMD} http://blzdistsc2-a.akamaihd.net/Linux/SC2.${GAME_VERSION}.zip 25 | ${WGET_CMD} http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season1.zip 26 | ${WGET_CMD} http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season2.zip 27 | ${WGET_CMD} http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season3.zip 28 | ${WGET_CMD} http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip 29 | 30 | popd 31 | -------------------------------------------------------------------------------- /game/make-container.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This builds the container for running the game 4 | IMAGE_NAME=s2client-game 5 | SCRIPT_PATH=${0%/*} 6 | 7 | echo ${IMAGE_NAME} docker image building using ${SCRIPT_PATH}/Dockerfile 8 | docker build ${SCRIPT_PATH} -t ${IMAGE_NAME} 9 | -------------------------------------------------------------------------------- /game/run-interactive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Run an interactive container with the build (see build/all.sh) 4 | docker run \ 5 | --entrypoint="/bin/bash" \ 6 | -v code:/code \ 7 | -v build:/build \ 8 | -it s2client-game 9 | -------------------------------------------------------------------------------- /game/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Run an interactive container with the build (see build/all.sh) 4 | docker run \ 5 | --entrypoint "/build/all_tests" \ 6 | -v build:/build \ 7 | -v code:/code \ 8 | -t s2client-game \ 9 | -e /SC2/3.16.1/StarCraftII/Versions/Base55958/SC2_x64 10 | -------------------------------------------------------------------------------- /game/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Run a background container with the build (see build/all.sh) 4 | docker run -P \ 5 | -v code:/code \ 6 | -v build:/build \ 7 | -d s2client-game 8 | -------------------------------------------------------------------------------- /game/unpack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This unpacks all of the zip files automatically 4 | 5 | SCRIPT_PATH=${0%/*} 6 | . ${SCRIPT_PATH}/../config.sh 7 | 8 | pushd downloads 9 | 10 | if [ ! -d ${GAME_VERSION}/StarCraftII ]; then 11 | $UNZIP_CMD SC2.${GAME_VERSION}.zip -d ${GAME_VERSION} 12 | fi 13 | 14 | MAP_DIRECTORY=${GAME_VERSION}/StarCraftII/Maps 15 | 16 | for i in `ls -1 {Ladder,Melee}*.zip`; do 17 | $UNZIP_CMD -n -d $MAP_DIRECTORY $i 18 | done 19 | 20 | cp -r s2client-api/maps/* $MAP_DIRECTORY/ 21 | 22 | popd 23 | -------------------------------------------------------------------------------- /replays/add-replays.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # This script downloads the replay pack, adds it to a running container 5 | # 6 | SCRIPT_PATH=${0%/*} 7 | . ${SCRIPT_PATH}/../config.sh 8 | 9 | 10 | # Download and extract the replay pack if it doesn't exist 11 | # 12 | # TODO: make replay pack handling more dynamic 13 | # 14 | REPLAY_PACK=3.16.1-Pack_1-fix.zip 15 | 16 | mkdir -p downloads 17 | if [ ! -f downloads/${REPLAY_PACK} ]; then 18 | pushd downloads 19 | wget -c http://blzdistsc2-a.akamaihd.net/ReplayPacks/${REPLAY_PACK} 20 | mkdir -p replays 21 | ${UNZIP_CMD} ${REPLAY_PACK} -d replays/ 22 | popd 23 | fi 24 | 25 | # 26 | # Start a new game container if GAME_CONTAINER is not yet defined 27 | # 28 | if [ "${GAME_CONTAINER}" == "" ]; then 29 | export GAME_CONTAINER=`docker run -d s2client-game` 30 | echo "New game container started ${GAME_CONTAINER}" 31 | fi 32 | 33 | 34 | # 35 | # TODO: Replays can use a mount, cache should be joined and either 36 | # mounted or copied in. 37 | # 38 | SRC_PATH="downloads/replays/Replays" 39 | DEST_PATH="/SC2/${GAME_VERSION}/StarCraftII/Replays/" 40 | 41 | echo "Copying into ${GAME_CONTAINER} ${SRC_PATH} -> ${DEST_PATH}" 42 | #docker cp ${SRC_PATH} ${GAME_CONTAINER}:${DEST_PATH} 43 | 44 | SRC_PATH="downloads/replays/Battle.net/" 45 | DEST_PATH="/SC2/${GAME_VERSION}/StarCraftII/Battle.net/" 46 | 47 | echo "Copying into ${GAME_CONTAINER} ${SRC_PATH} -> ${DEST_PATH}" 48 | #docker cp ${SRC_PATH} ${GAME_CONTAINER}:${DEST_PATH} 49 | --------------------------------------------------------------------------------