Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
69 changes: 59 additions & 10 deletions .github/workflows/build-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,78 @@ on:
push:
branches:
- main
- testing
workflow_dispatch:

jobs:
push_to_registry:
name: Build and Push to DockerHub Registry
name: Build and Push Docker Image
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: actions/checkout@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
fetch-depth: 0

- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
suffix=-${{ matrix.python-version }}
tags: |
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
type=raw,value=latest,suffix=,enable=${{ github.ref_name == github.event.repository.default_branch }}
images: |
name=${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer,enable=false
name=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}

- name: Build and Push Base Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
INVOKER_ID=${{ secrets.INVOKER_ID }}
INVOKER_KEY=${{ secrets.INVOKER_KEY }}
INVOKER_REGION=${{ secrets.INVOKER_REGION }}

# name: Build and Push to DockerHub Registry
# runs-on: ubuntu-latest

# steps:
# - name: Checkout
# uses: actions/checkout@v2

# - name: Log in to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

# - name: Build and Push Base Image
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: ${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer
# build-args: |
# INVOKER_ID=${{ secrets.INVOKER_ID }}
# INVOKER_KEY=${{ secrets.INVOKER_KEY }}
# INVOKER_REGION=${{ secrets.INVOKER_REGION }}
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Base image is Python 3.8 provided by AWS Lambda in Docker Hub
FROM public.ecr.aws/lambda/python:3.8
ARG PYTHON_VERSION

# Base image is Python 3.X provided by AWS Lambda in Docker Hub
FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}

WORKDIR /app

Expand Down