Creating a Task Environment

Create a task environment to specify the container image, runtime settings, task environment variables, and shared storage mounts that the Batch tasks require.

  • On the Task environments list page, select Create task environment and provide information in each section. If you need help finding the list page, see Listing Task Environments.

    1. Basic Information

    • Name: Enter the task environment name.
    • Description: Provide a brief description of the task environment.
    • Compartment: Select the compartment in which you want to create the task environment.
    • Image compartment: Select the compartment where the Docker image is available.
    • Image: Select the Docker image that contains the software suite and all supporting programs to run.

    2. Security Context

    • User ID: Select the user ID that the container must run as.
    • Group ID: Select the group ID for the primary group under which the container runs.
    • Filesystem group ID: Select the filesystem group ID that the container adds to its supplemental group.
    • Working directory: Enter the working directory that the application expects. The container runs all commands in the directory by default when it starts (for example, /).

    3. Attachments

    In the NFS volumes section, specify the storage mount details for the batch tasks. NFS volumes provide storage for reading and writing data across jobs. Select Add NFS volume and complete the following fields:

    • Name: Enter a name to identify the fleet mount in the task environment.
    • NFS URI: Private Fully Qualified Domain Name (FQDN) of the NFS server or endpoint that provides the shared storage.
    • Source Path and Directory: The export path on the NFS server where the shared files are located.
    • Destination Path and Directory: The path inside the container where the NFS volume is mounted.

    4. (Optional) Tags

    In the Tags section, select Add Tag to add one or more tags to the task environment. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.

  • Use the oci batch batch-task-environment create command and required parameters to create a batch task environment:
    oci batch batch-task-environment create [OPTIONS]

    For a complete list of flags and variable options for Batch CLI commands, see the Batch CLI.

  • Run the CreateBatchTaskEnvironment operation to create a task environment.