Developer Documentation

Create an Image

Creates a new image for use in deployments. There are many options available for creating an image, allowing you to customize settings such as the Docker image, registry, and Steamworks integration.

Info

If you provide your own docker images you need to register a registry within ODIN Fleet. You can do this in the console. More info can be found in our Adding Registries Guide in the Manual. You will need the ID of the registry to register a docker image with ODIN Fleet. If you want to use Steamworks images, you need to provide the Steam App ID of the game or tool you want to use.

Usage

odin fleet images create [--name=IMAGE_NAME] [--version=IMAGE_VERSION] [--os=IMAGE_OS] [--type=IMAGE_TYPE] [--docker-image=DOCKER_IMAGE] [--registry-id=REGISTRY_ID] [--steam-app-id=STEAM_APP_ID] [--branch=STEAM_BRANCH] [--password=STEAM_PASSWORD] [--command=STEAM_COMMAND] [--steamcmd-username=STEAMCMD_USERNAME] [--steamcmd-password=STEAMCMD_PASSWORD] [--runtime=STEAM_RUNTIME] [--headful] [--request-license] [--unpublished] [payload=JSON_PAYLOAD] [--dry-run]

Flags

If you want to create an image interactively, you can run the command without any flags. The CLI will prompt you for the required information.

  • --dry-run:
    An optional flag that shows the JSON payload that would be sent to the API without actually creating the image. You can use that payload to create the image with the --payload flag.

  • --payload=<string>:
    An optional flag that allows you to specify a JSON payload to create the image. This is useful for non-interactive mode and if you want to create an image with a specific configuration.

Instead of providing a JSON payload, you can use the following options to create an image:

  • --name=<string>:
    The name of the image. This is a required option to identify the image.

  • --version=<string>:
    Specifies the version of the image. This can be useful for managing different iterations of the same image.

  • --os=<string>:
    Defines the operating system that the image is based on. For example, it could be linux, windows, etc.

  • --type=<string>:
    Specifies the type of the image. This is either dockerImage or steam.

These options need to be provided to create a docker image (i.e. --type=dockerImage):

  • --docker-image=<string>:
    The name of the Docker image to use. This should be the full path to the Docker image in the registry.

  • --registry-id=<number>:
    The ID of the Docker registry where the image is stored. This is useful if you have multiple Docker registries configured. You can get the registry ID in the console https://console.4players.io/settings/docker-registries

Provide these options to create a Steam image (i.e. --type=steam):

  • --steam-app-id=<number>:
    The Steam App ID associated with the image. This is required if the image is related to a Steam application.

  • --branch=<string>:
    Specifies the Steam branch to use. This allows you to choose between different branches (e.g., beta, stable) of a Steam game or application.

  • --password=<string>:
    The password associated with the Steam branch, if required. This is typically used for private or protected branches.

  • --command=<string>:
    Specifies a command to be run by Steam, useful for custom deployment scripts or specific launch commands.

  • --steamcmd-username=<string>:
    The username for SteamCMD. Required for downloading and managing Steam games or tools via the command line.

  • --steamcmd-password=<string>:
    The password for SteamCMD. This is used in conjunction with the SteamCMD username to authenticate and perform operations.

  • --runtime=<string>:
    Specifies the Steam runtime environment. This might be necessary for games or applications that require a specific runtime version.

  • --headful:
    An optional flag that enables Steam in headful mode, where a graphical interface might be needed for certain operations.

  • --request-license:
    An optional flag to request a Steam license, usually needed for restricted or license-protected games.

  • --unpublished:
    If your Steam app is not published, you need to set this flag, otherwise leave it out.

Examples

You can use the --format flag to customize the output format. For example, to just display/get the image ID you can use the --format="value(id)" flag.

odin fleet images create --name=<image_name> --type=dockerImage --docker-image=<docker_image> --registry-id=<registry_id> --format="value(id)"

This is useful for bash scripts or other automation tasks, where you want to use the ID of the created image in the next command. A full example could look like this:

IMAGE_ID=$(
  odin fleet images create \
  --name="Example Image" \
  --type="dockerImage" \
  --docker-image="example/example-image:latest" \    
  --registry-id=1 \
  --force \
  --format="value(id)")
  
echo "Created image with ID: $IMAGE_ID"

Global Flags

The following flags can be used with any ODIN CLI command:

  • --api-key=<string>
    The API key to use for authentication. If omitted, the CLI will use the api-key stored in the configuration file on your system. Use odin login to store the API key for subsequent commands.

  • --app-id=<string>
    The ID of the app to use for the command. If omitted, the CLI will use the currently selected app. Use odin apps select to select an app interactively.

  • --format=<string>
    The output format to use for the command. Supported formats are json, value, flattened and table. If omitted, the CLI will use the default format specified in the configuration file. Learn more about output formatting.

  • --force
    Forces the command to execute without prompting for confirmation. Use with caution.

  • --quiet
    Suppresses all informational output except for errors. Useful for scripting and automation.