From 96c5173646c6188f6041d97724ca1c24d8ca8ed1 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Mon, 20 May 2024 20:54:38 -0700 Subject: [PATCH] docker updates --- .github/workflows/deploy.yml | 2 +- docker/Dockerfile | 4 +--- docker/build.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b2d2b662..8630a2db 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -66,7 +66,7 @@ jobs: ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} IMAGE_TAG: latest run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . + docker build --platform linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - name: Update Lambda function to use new Docker image diff --git a/docker/Dockerfile b/docker/Dockerfile index 6da132d5..cea8944e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,10 +2,8 @@ FROM public.ecr.aws/lambda/python:3.11 -WORKDIR /app - # Installs the package in the container. -ADD . /app +ADD . ${LAMBDA_TASK_ROOT} RUN pip install --no-cache-dir . # Runs the application. diff --git a/docker/build.sh b/docker/build.sh index 14f9e0da..6475ecd1 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -12,4 +12,4 @@ if [[ ! -f "store/requirements.txt" ]]; then fi # Builds the API Docker image. -docker build -t kscale-store -f docker/Dockerfile . +docker build --platform linux/amd64 -t kscale-store -f docker/Dockerfile .