Skip to content

Commit

Permalink
Add base docker image and ci script for building and pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Sep 22, 2023
1 parent cab55e9 commit 1f5be44
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/_release_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: release_docker

on:
workflow_call:
inputs:
working-directory:
default: "docker"
required: true
type: string
description: "From which folder this pipeline executes"
dockerfile:
required: true
type: string
description: "Name of the Dockerfile to build, relative to the working directory"
image-name:
required: true
type: string
description: "Name of the image to build"

env:
TEST_TAG: ${{ inputs.image-name }}:test
LATEST_TAG: ${{ inputs.image-name }}:latest

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }} python -c "import langchain"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
# push: true
tags: ${{ env.LATEST_TAG }}
13 changes: 13 additions & 0 deletions .github/workflows/langchain_release_docker_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: docker/langchain/base Release

on:
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI

jobs:
release:
uses: ./.github/workflows/_release_docker.yml
with:
dockerfile: Dockerfile.base
image-name: langchain/base
secrets: inherit
3 changes: 3 additions & 0 deletions docker/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM python:latest

RUN pip install langchain

0 comments on commit 1f5be44

Please sign in to comment.