fix(agent): Unbreak docker builds after repo restructure (#7164)

- Move `autogpt/Dockerfile` to `Dockerfile.autogpt`
  - Write new selective `.dockerignore` (in repo root) to keep build context clean
  - Amend `autogpt/docker-compose.yml` and all `autogpt-docker-*.yml` workflows accordingly

- Include `forge/` in docker build context so it can be used as a path dependency

- Include `frontend/` in docker builds
This commit is contained in:
Reinier van der Leer
2024-05-22 18:11:16 +02:00
committed by GitHub
parent e16d58af0c
commit 5292736779
7 changed files with 55 additions and 36 deletions

View File

@@ -25,7 +25,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpt
file: Dockerfile.autogpt
build-args: BUILD_TYPE=${{ matrix.build-type }}
load: true # save to docker images
# use GHA cache as read-only

View File

@@ -49,7 +49,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpt
file: Dockerfile.autogpt
build-args: BUILD_TYPE=${{ matrix.build-type }}
tags: ${{ env.IMAGE_NAME }}
labels: GIT_REVISION=${{ github.sha }}
@@ -84,7 +84,6 @@ jobs:
vars_json: ${{ toJSON(vars) }}
run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY
working-directory: ./
continue-on-error: true
test:
@@ -119,7 +118,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpt
file: Dockerfile.autogpt
build-args: BUILD_TYPE=dev # include pytest
tags: >
${{ env.IMAGE_NAME }},

View File

@@ -10,10 +10,6 @@ on:
type: boolean
description: 'Build from scratch, without using cached layers'
defaults:
run:
working-directory: autogpt
env:
IMAGE_NAME: auto-gpt
DEPLOY_IMAGE_NAME: ${{ secrets.DOCKER_USER }}/auto-gpt
@@ -48,7 +44,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpt
file: Dockerfile.autogpt
build-args: BUILD_TYPE=release
load: true # save to docker images
# push: true # TODO: uncomment when this issue is fixed: https://github.com/moby/buildkit/issues/1555
@@ -87,5 +83,4 @@ jobs:
vars_json: ${{ toJSON(vars) }}
run: .github/workflows/scripts/docker-release-summary.sh >> $GITHUB_STEP_SUMMARY
working-directory: ./
continue-on-error: true