Skip to content

Commit 1da1589

Browse files
committed
cache cleaning and commented out public image stuff
1 parent 846d3d5 commit 1da1589

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ENV CONDAENV "/opt/conda/envs/${CONDA_ENV_NAME}"
2020
# Create the environment:
2121
COPY build-environment.yml .
2222
RUN conda env create -f build-environment.yml
23+
RUN mamba update --all -y
2324

2425
COPY run-environment.yml .
2526
RUN conda env create -f run-environment.yml

build-environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ channels:
33
- conda-forge
44
dependencies:
55
- conda-pack
6+
- mamba

build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ then
77
echo "container name not set! please execute './build.sh containername'"
88
exit 1;
99
fi
10+
WIPE_CACHE="$2"
11+
if [ -z "$WIPE_CACHE" ]; then
12+
echo "Not wiping cache";
13+
else
14+
WIPE_CACHE="--no-cache"
15+
echo "Wiping cache '$WIPE_CACHE'";
16+
17+
fi
18+
1019
region=$AWS_DEFAULT_REGION
1120
if [ -z "$region" ]
1221
then
@@ -21,6 +30,8 @@ then
2130
fi
2231

2332
CONTAINER_NAME=$identity.dkr.ecr.$region.amazonaws.com/$container
33+
#CONTAINER_NAME=public.ecr.aws/d4n0a3t5/$container
34+
2435

2536
LAMBDA_IMAGE="amazon/aws-lambda-provided:al2"
2637
docker buildx build -t $CONTAINER_NAME:amd64 . \
@@ -33,4 +44,5 @@ LAMBDA_IMAGE="amazon/aws-lambda-provided:al2.2023.12.14.13"
3344
docker buildx build -t $CONTAINER_NAME:arm64 . \
3445
-f Dockerfile --platform linux/arm64 \
3546
--build-arg LAMBDA_IMAGE=$LAMBDA_IMAGE \
47+
$WIPE_CACHE \
3648
--build-arg RIE_ARCH=arm64 --load

push.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ region="$AWS_DEFAULT_REGION"
1111
echo "region: ${region}"
1212

1313
# login to docker
14-
eval $(aws ecr get-login --no-include-email --region ${region})
1514
identity=$(aws sts get-caller-identity --query 'Account' --output text)
1615

16+
COMMAND="aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $identity.dkr.ecr.$region.amazonaws.com"
17+
#COMMAND="aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/d4n0a3t5"
18+
19+
echo "$COMMAND"
20+
eval $COMMAND
21+
1722
repository=$(aws ecr describe-repositories --repository-names $container)
1823
echo "repository: ${repository}"
1924

@@ -22,17 +27,24 @@ for tag in amd64 arm64;
2227
do
2328
echo $Item
2429
CONTAINER_NAME=${identity}.dkr.ecr.${region}.amazonaws.com/${container}:$tag
30+
# CONTAINER_NAME=public.ecr.aws/d4n0a3t5/$container:$tag
2531
echo $CONTAINER_NAME
2632
docker push "$CONTAINER_NAME"
2733
done
2834

2935

3036

37+
#CONTAINER_NAME=public.ecr.aws/d4n0a3t5/$container:latest
38+
#docker manifest create "$CONTAINER_NAME" \
39+
# --amend "public.ecr.aws/d4n0a3t5/${container}:arm64" \
40+
# --amend "public.ecr.aws/d4n0a3t5/${container}:amd64"
3141
CONTAINER_NAME=${identity}.dkr.ecr.${region}.amazonaws.com/${container}:latest
42+
docker manifest rm "$CONTAINER_NAME"
3243
docker manifest create "$CONTAINER_NAME" \
33-
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:arm64" \
34-
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:x86_64"
44+
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:arm64" \
45+
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:amd64"
46+
3547

3648
docker manifest inspect $CONTAINER_NAME
3749

38-
docker manifest push "$CONTAINER_NAME"
50+
docker manifest push "$CONTAINER_NAME"

run-environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ dependencies:
1010
- Shapely
1111
- gdal
1212
- pyproj
13+
- mamba

0 commit comments

Comments
 (0)