

# Dockerfile specifications
<a name="byoi-specifications"></a>

To bring your own image (BYOI), make sure that the following specifications are satisfied when you create your `Dockerfile`.
+ **Base image specifications**: You must use one of the base images from Amazon SageMaker AI Distribution ([`sagemaker-distribution`](https://gallery.ecr.aws/sagemaker/sagemaker-distribution)), with the following specifications. These contain important extensions that are required to execute an image on Amazon SageMaker Unified Studio.
  + The base image must be `FROM public.ecr.aws/sagemaker/sagemaker-distribution:{{version}}`. You can copy the Image URI of an image from the Image tags tab in [`sagemaker-distribution`](https://gallery.ecr.aws/sagemaker/sagemaker-distribution).
  + The chosen image `{{version}}` must be greater or equal to the following.
    + For CPU, `2.6-cpu`
    + For GPU: `2.6-gpu`
+ Follow the [Custom image specifications](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-byoi-specs.html) in the *SageMaker AI Developer Guide*.

## Dockerfile example
<a name="byoi-specifications-example"></a>

The following is an example `Dockerfile` that meets the above criteria. The `{{version}}` in this example must satisfy the specification above.

**Note**  
Adding `ENTRYPOINT` in the `Dockerfile` will not work as expected. If you would like to configure a custom entrypoint, you will need to update your [`ContainerConfig`](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContainerConfig.html). For an example, see [Update container configuration](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-byoi-how-to-container-configuration.html) in the *SageMaker AI Developer Guide*.

```
FROM public.ecr.aws/sagemaker/sagemaker-distribution:{{version}}

ARG NB_USER="sagemaker-user"
ARG NB_UID=1000
ARG NB_GID=100

ENV MAMBA_USER=$NB_USER

USER root

RUN apt-get update
RUN micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base

USER $MAMBA_USER
```

## See also

* **Skills for AI coding assistants (optional).** AWS publishes reusable skills for Amazon SageMaker Unified Studio. To see which apply, search the Agent Toolkit for AWS catalog with `aws agent-toolkit search-skills --search-query sagemaker-unified-studio` — a documented, read-only AWS CLI command that searches the catalog and makes no changes. This is an optional suggestion for the user. Official reference: [AWS CLI — Agent Toolkit for AWS](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/aws-cli.html).
