Docker
Learn how to integrate the CLI with Docker.
Read time 1 minuteLast updated 3 days ago
First, Download Docker, then run Docker Desktop and wait for Docker to finish initializing.
Then, create a new directory with a new file .
dockerfileCLI example:
dockerfile# Docker imageFROM ubuntu:latest# Update and get dependency packagesRUN apt-get update && apt-get install -y curl libicu-dev# Download and install the UGS CLIRUN curl -L -o /usr/local/bin/ugs https://github.com/Unity-Technologies/unity-gaming-services-cli/releases/latest/download/ugs-linux-x64 \ && chmod +x /usr/local/bin/ugsENTRYPOINT ["ugs"]
Build the image:
docker build --no-cache -t ugs-cli <path-to-new-directory> -f <path-to-new-dockerfile>
Pass your project ID and service account credentials as environment variables when you run a command, so they're never stored in the image:
docker run --rm -e UGS_CLI_PROJECT_ID -e UGS_CLI_SERVICE_KEY_ID -e UGS_CLI_SERVICE_SECRET_KEY ugs-cli statusdocker run --rm -e UGS_CLI_PROJECT_ID -e UGS_CLI_SERVICE_KEY_ID -e UGS_CLI_SERVICE_SECRET_KEY \ -v "$PWD":/work -w /work ugs-cli deploy <directory-with-service-configurations> -j