Skip to content

Commit 125faa1

Browse files
authored
Merge pull request #258 from CerebriumAI/docs/public-docker-hub-images-auth
Docs/public docker hub images auth
2 parents b0d063d + 4a5f9a0 commit 125faa1

File tree

2 files changed

+43
-36
lines changed

2 files changed

+43
-36
lines changed

cerebrium/container-images/defining-container-images.mdx

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -175,61 +175,62 @@ The base image selection shapes how an app runs in Cerebrium. While the default
175175

176176
### Supported Base Images
177177

178-
Cerebrium supports several categories of base images to ensure system compatibility:
178+
Cerebrium supports several categories of base images to ensure system compatibility such as nvidia, ubuntu and python images.
179179

180180
```toml
181181
[cerebrium.deployment]
182-
# Default minimal image
183-
docker_base_image_url = "debian:bookworm-slim"
182+
docker_base_image_url = "debian:bookworm-slim" # Default minimal image
183+
#docker_base_image_url = "nvidia/cuda:12.0.1-runtime-ubuntu22.04" # CUDA-enabled images
184+
#docker_base_image_url = "ubuntu:22.04" # debian images
184185
```
185186

186-
```toml
187-
[cerebrium.deployment]
188-
# CUDA-enabled images
189-
docker_base_image_url = "nvidia/cuda:12.0.1-runtime-ubuntu22.04"
190-
```
191-
192-
The system accepts these image types:
187+
<Tip>
188+
Starting with a minimal Debian or Ubuntu base image is recommended, as CUDA
189+
images include many pre-installed components that increase container size.
190+
While the relationship isn't strictly linear, larger container sizes generally
191+
lead to longer cold-starts and build times. Begin with a lean base image and
192+
add only essential components as needed.
193+
</Tip>
193194

194-
#### Ubuntu-based CUDA Images
195+
#### Public Docker Hub Images with Namespaces
195196

196-
All Ubuntu-based `nvidia/cuda` images that include Ubuntu are supported. These include the CUDA libraries necessary to provide GPU acceleration:
197+
When using public Docker Hub images that include a namespace (e.g., `bob/infinity`, `huggingface/transformers`), you need to be logged in to Docker Hub locally, even though the image is public. This is because Cerebrium reads your `~/.docker/config.json` to authenticate image pulls.
197198

198-
```toml
199-
[cerebrium.deployment]
200-
docker_base_image_url = "nvidia/cuda:12.0.1-devel-ubuntu22.04"
199+
```bash
200+
# Login to Docker Hub with username (required for namespace/image format)
201+
docker login -u your-dockerhub-username
202+
# Enter your password or access token when prompted
201203
```
202204

203-
#### Debian and Ubuntu Base Images
204-
205-
Any Debian or Ubuntu base image works as a foundation:
205+
After logging in, you can use the image in your configuration:
206206

207207
```toml
208208
[cerebrium.deployment]
209-
docker_base_image_url = "debian:bullseye"
209+
docker_base_image_url = "bob/infinity:latest"
210210
```
211211

212-
```toml
213-
[cerebrium.deployment]
214-
docker_base_image_url = "ubuntu:22.04"
215-
```
212+
<Note>
213+
Official Docker Hub images without a namespace (like `python:3.11`,
214+
`debian:bookworm`, `ubuntu:22.04`) work without requiring a Docker login. Only
215+
images in the `namespace/image` format require authentication.
216+
</Note>
216217

217-
#### Python Images
218+
<Warning>
219+
Use `docker login -u username` instead of just `docker login`. The latter may
220+
use Docker's web-based OAuth flow which creates tokens that are incompatible
221+
with our build system.
222+
</Warning>
223+
224+
#### Public AWS ECR Images
218225

219-
Python images based on Debian bullseye or bookworm provide pre-configured Python environments:
226+
Public ECR images from the `public.ecr.aws` registry work without authentication:
220227

221228
```toml
222229
[cerebrium.deployment]
223-
docker_base_image_url = "python:3.11-bookworm"
230+
docker_base_image_url = "public.ecr.aws/lambda/python:3.11"
224231
```
225232

226-
<Tip>
227-
Starting with a minimal Debian or Ubuntu base image is recommended, as CUDA
228-
images include many pre-installed components that increase container size.
229-
While the relationship isn't strictly linear, larger container sizes generally
230-
lead to longer cold-starts and build times. Begin with a lean base image and
231-
add only essential components as needed.
232-
</Tip>
233+
However, **private ECR images** require authentication. See [Using Private Docker Registries](/cerebrium/container-images/private-docker-registry) for setup instructions.
233234

234235
## Custom Runtimes
235236

cerebrium/container-images/private-docker-registry.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ Based on your registry, login using one of the following commands:
2121
**Docker Hub:**
2222

2323
```bash
24-
docker login
25-
# Enter username and password/token when prompted
24+
docker login -u your-dockerhub-username
25+
# Enter your password or access token when prompted
2626
```
2727

28+
<Warning>
29+
Use `docker login -u username` instead of just `docker login`. The latter may
30+
use Docker's web-based OAuth flow which creates tokens that are incompatible
31+
with our build system.
32+
</Warning>
33+
2834
**AWS ECR:**
2935

3036
```bash
@@ -36,7 +42,7 @@ aws ecr get-login-password --region us-east-1 | \
3642
**Generic Registry:**
3743

3844
```bash
39-
docker login registry.company.com
45+
docker login -u your-username registry.company.com
4046
# Enter credentials when prompted
4147
```
4248

0 commit comments

Comments
 (0)