[Yandex Cloud documentation](../../index.md) > [Yandex DataSphere](../index.md) > [Concepts](index.md) > Resources > Docker images

# Docker images

You can set up a DataSphere project environment on your own by using a [_Docker image_](https://docs.docker.com/engine/reference/commandline/image/) with any software, libraries, environment variables, and configuration files. The Docker image you apply to your project will be used when running code in all its notebooks.

You cannot change Docker images after you create them.

{% note warning %}

Starting January 31, 2027, all Docker images created in DataSphere before December 3, 2026, will no longer work. To use these images in projects, recreate them or use the migration tool.

{% endnote %}

## Ways to store Docker images {#storage}

There are two ways to store Docker images:
* In [Yandex Container Registry](../../container-registry/index.md)
* In DataSphere

### Storage in Container Registry {#cr}

By default, Docker images are stored in Container Registry. They are built on a DataSphere VM and, if successful, pushed to the registry specified in the community settings, with its version logged in the relevant DataSphere resource. Whenever a project using this image runs, DataSphere pulls this version from the registry. Deleting the image version from the registry keeps the image in the project but disables its further optimization, activation, or use.

Storing images in Container Registry is cheaper, but it increases the project start time. You also cannot share an image from the registry with the community.

To reduce the project start time, you can create an optimized copy of your Docker image stored in Container Registry. This optimized copy is stored on a separate disk in DataSphere and greatly reduces start time, but storing it adds extra [charges](../pricing.md#storage). You can [publish](../operations/user-images.md#share) an optimized Docker image in the community to use it in multiple projects. 

After you create an optimized copy, you can delete the original image from the registry to avoid paying for storing both the original and the copy. If you delete an optimized copy of the Docker image, DataSphere will attempt to pull the Docker image from Container Registry again when the project starts. The project will continue using the original version if it is still available in Container Registry. 

{% note tip %}

To allow project users to build and store Docker images in Container Registry, the community administrator should specify the registry in the community settings and enable the [service agent](../operations/community/create-ssa.md).

{% endnote %}

### Storage in DataSphere {#datasphere}

If you select DataSphere for storage when creating a Docker image, it will be stored on a dedicated disk in DataSphere once built and will not be pushed to Container Registry. This image is immediately considered optimized and billed accordingly.

If you delete a Docker image stored in DataSphere, you will not be able to restore it.

You can [publish](../operations/user-images.md#share) a Docker image stored in DataSphere in the community to use it in multiple projects. To do this, you need at least the `Editor` role in the project and the `Developer` role in the community you want to publish it in. You can open the access on the **Access** tab on the Docker image view page. The resource available to the community will appear on the community page under **Community resources**. While the image is published, you cannot delete it.

For more information on working with Docker images, see [Working with Docker images](../operations/user-images.md).

## Docker image requirements {#requirements}

For a Docker image to run and work correctly in DataSphere, it must include:
* Python 3.8, 3.9, 3.10, or 3.11 installation
* Pip installation
* `--uid 1000 jupyter` user

{% note tip %}

The [Docker Hub](https://hub.docker.com/) image library has limits on anonymous usage. If you encounter slow or failed base image pulls when building a Docker image, try changing your project IP address. To do this:

* [Create a subnet](../../vpc/operations/subnet-create.md).
* [Create an egress NAT gateway](../../vpc/operations/create-nat-gateway.md).
* [Create a service account](../../iam/operations/sa/create.md) with the `vpc.user` role.
* In the [project settings](../operations/projects/update.md), add the subnet and the service account you created.

You can also use basic images from other libraries.

{% endnote %}

{% note info %}

The Docker image templates available in DataSphere already meet these requirements. If you are downloading an image from a third-party source or writing your own, include the required commands.

{% endnote %}

#### Useful links {#see-also}

[Working with Docker images](../operations/user-images.md)