Skip to content

Error while creating a new container image #1906

@11elangelm

Description

@11elangelm

Describe the bug
Error on a sagemaker instance while creating a new container.

To reproduce
%%sh

The name of our algorithm

algorithm_name=sagemaker-python
set -eu # stop if anything fails
account=$(aws sts get-caller-identity --query Account --output text)

Get the region defined in the current configuration (default to us-west-2 if none defined)

region=$(aws configure get region)
region=${region:-us-east-2}
fullname="${account}.dkr.ecr.${region}.amazonaws.com/${algorithm_name}:latest"

If the repository doesn't exist in ECR, create it.

aws ecr describe-repositories --repository-names "${algorithm_name}" > /dev/null 2>&1
if [ $? -ne 0 ]
then
aws ecr create-repository --repository-name "${algorithm_name}" > /dev/null
fi

Get the login command from ECR and execute it directly

$(aws ecr get-login --region ${region} --no-include-email)

Build the docker image locally with the image name and then push it to ECR

with the full name.

docker build -t ${algorithm_name} . ***this line returns '' returned non-zero exit status 1.
docker tag ${algorithm_name} ${fullname}
docker push ${fullname}

Expected behavior
This should create the docker image in my ecr repository.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.
image

System information
Conda_python 3. Python.

Additional context
I'm following this link
https://github.com/awslabs/amazon-sagemaker-examples/blob/master/advanced_functionality/pipe_bring_your_own/pipe_bring_your_own.ipynb

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions