Skip to content

Commit

Permalink
CI: Build using docker action
Browse files Browse the repository at this point in the history
Change to build the image using docker action, this should then allow
the docker action's cache to be used. Subsequently reducing build time
~50%, as the image will only need to be built once. Currently image is
built twice.

The default driver uses double the disk space, see
docker/build-push-action/issues/321 (in brief the image is build in the
build-push-action local cache and then transfered to the local docker).
This is a problem as this image is so large. Using the `docker` driver
will workaround this.
  • Loading branch information
master-bob committed Apr 1, 2023
1 parent d1608d5 commit dda9dff
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c
with:
driver: docker

- name: Pre build
run: |
Expand Down Expand Up @@ -90,13 +92,12 @@ jobs:
# check disk space one more time
df -h
- name: Build local docker image for test
# if: github.event_name != 'pull_request'
run: |
TAG=$GITHUB_SHA
docker build . \
--file Dockerfile \
--tag ${{ env.IMAGE_NAME}}:${{ env.TAG}}
- name: Build and load local docker image for test
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ${{ env.IMAGE_NAME}}:${{ env.TAG}}

- name: Inspect local docker image
run: |
Expand Down

0 comments on commit dda9dff

Please sign in to comment.