aws / aws/sagemaker-distribution

Example custom Docker image doesn't build

Open
#1,017 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
154
Forks
120
Avg merge
5d 4h
Merged PRs (30d)
27

Description

### Category

Compatibility Issue

### 🐛 Describe the bug

In the README you have the custom Dockerfile example as

```
FROM public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu
USER $ROOT
RUN apt-get install -y vim
USER $MAMBA_USER
RUN micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base
```

However upon building it will result in the following error

```
=> ERROR [3/3] RUN micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base 25.1s
------
> [3/3] RUN micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base:
0.250 warning libmamba Cache file "/home/sagemaker-user/.conda/pkgs/cache/88ec62ec.json" was modified by another program
0.251 warning libmamba Cache file "/home/sagemaker-user/.conda/pkgs/cache/eb045dd1.json" was modified by another program
10.89
10.89 Pinned packages:
10.89
10.89 - python=3.12
10.89
24.96 error libmamba Could not solve for environment specs
24.96 The following packages are incompatible
24.96 ├─ retrying =* * is not installable because it conflicts with any installable versions previously reported;
24.96 └─ sagemaker-inference =* * is not installable because there are no viable options
24.96 ├─ sagemaker-inference [1.10.0|1.10.1|1.9.2|1.9.3] would require
24.96 │ └─ retrying >=1.3.3,<1.4 *, which conflicts with any installable versions previously reported;
24.96 └─ sagemaker-inference [1.5.10|1.5.11|...|1.7.0] would require
24.96 └─ retrying ==1.3.3 *, which conflicts with any installable versions previously reported.
24.96 Possible hints:
24.96 - 'freeze_installed' is turned on
24.96
25.04 critical libmamba Could not solve for environment specs
------

2 warnings found (use docker --debug to expand):
- UndefinedVar: Usage of undefined variable '$ROOT' (line 2)
- InvalidBaseImagePlatform: Base image public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 1)
Dockerfile:5
--------------------
3 | RUN apt-get install -y vim
4 | USER $MAMBA_USER
5 | >>> RUN micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base
--------------------
ERROR: failed to build: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh micromamba install sagemaker-inference --freeze-installed --yes --channel conda-forge --name base" did not complete successfully: exit code: 1
```

Locally I have resolved this by removing the `--freeze-installed.

### 🐛 Describe the expected behavior

For the image to build successfuly

### Image Tags

latest-cpu, 2.11-cpu

Contributor guide

Open the contributing guide

Research direction

Start with the custom Dockerfile example in the README and reproduce the build for the latest-cpu and 2.11-cpu image tags. Check the micromamba install command and its pinned Python environment, then verify that the documented example builds successfully without the reported dependency-resolution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python, shell
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.