Skip to content

Commit 350c567

Browse files
authored
Merge pull request aws#433 from ChoiByungWook/fix_extend
Fix dockerfile to work in other regions
2 parents 07653c6 + ad0a06d commit 350c567

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

advanced_functionality/pytorch_extending_our_containers/container/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
# For more information on creating a Dockerfile
1515
# https://docs.docker.com/compose/gettingstarted/#step-2-create-a-dockerfile
1616
# https://github.com/awslabs/amazon-sagemaker-examples/master/advanced_functionality/pytorch_extending_our_containers/pytorch_extending_our_containers.ipynb
17+
ARG REGION=us-west-2
18+
1719
# SageMaker PyTorch image
18-
FROM 520713654638.dkr.ecr.us-west-2.amazonaws.com/sagemaker-pytorch:0.4.0-cpu-py3
20+
FROM 520713654638.dkr.ecr.$REGION.amazonaws.com/sagemaker-pytorch:0.4.0-cpu-py3
1921

2022
ENV PATH="/opt/ml/code:${PATH}"
2123

advanced_functionality/pytorch_extending_our_containers/container/build_and_push.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $(aws ecr get-login --registry-ids 520713654638 --region ${region} --no-include-
4747
# Build the docker image locally with the image name and then push it to ECR
4848
# with the full name.
4949

50-
docker build -t ${image} .
50+
docker build -t ${image} . --build-arg REGION=${region}
5151
docker tag ${image} ${fullname}
5252

5353
docker push ${fullname}

advanced_functionality/pytorch_extending_our_containers/pytorch_extending_our_containers.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
"# Build the docker image locally with the image name and then push it to ECR\n",
323323
"# with the full name.\n",
324324
"\n",
325-
"docker build -t ${algorithm_name} .\n",
325+
"docker build -t ${algorithm_name} . --build-arg REGION=${region}\n",
326326
"docker tag ${algorithm_name} ${fullname}\n",
327327
"\n",
328328
"docker push ${fullname}"

0 commit comments

Comments
 (0)