# ImageSpec

During the development cycle you will want to be able to run your workflows both locally on your machine and remotely on Flyte,
so you will need to ensure that the required dependencies are installed in both environments.

Here we will explain how to set up the dependencies for your workflow to run remotely on Flyte.
For information on how to make your dependencies available locally, see [Local dependencies](https://www.union.ai/docs/v1/flyte/user-guide/development-cycle/image-spec/local-dependencies).

When a workflow is deployed to Flyte, each task is set up to run in its own container in the Kubernetes cluster.
You specify the dependencies as part of the definition of the container image to be used for each task using the `ImageSpec` class.
For example::

```python
import flytekit as fl

image_spec = union.ImageSpec(

    name="say-hello-image",
    requirements="uv.lock",
)

@fl.task(container_image=image_spec)
def say_hello(name: str) -> str:
    return f"Hello, {name}!"

@fl.workflow
def hello_world_wf(name: str = "world") -> str:
    greeting = say_hello(name=name)
    return greeting
```

Here, the `ImageSpec` class is used to specify the container image to be used for the `say_hello` task.

* The `name` parameter specifies the name of the image. This name will be used to identify the image in the container registry.

* The `requirements` parameter specifies the path to a file (relative to the directory in which the `pyflyte run` or `pyflyte register` command is invoked) that specifies the dependencies to be installed in the image.
  The file may be:
  * A `requirements.txt` file.
  * A `uv.lock` file generated by the `uv sync` command.
  * A `poetry.lock` file generated by the `poetry install` command.
  * A `pyproject.toml` file.

When you execute the `pyflyte run` or `pyflyte register` command, Flyte will build the container image defined in `ImageSpec` block
(as well as registering the tasks and workflows defined in your code).

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/user-guide/development-cycle/image-spec.md
**HTML**: https://www.union.ai/docs/v1/flyte/user-guide/development-cycle/image-spec/
