Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
7a556b22
Unverified
Commit
7a556b22
authored
May 20, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 20, 2024
Browse files
Merge pull request #2428 from cheahjs/feat/better-docker-caching
feat: cache docker layers to registry
parents
23859756
e142223e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
7 deletions
+37
-7
.github/workflows/docker-build.yaml
.github/workflows/docker-build.yaml
+37
-7
No files found.
.github/workflows/docker-build.yaml
View file @
7a556b22
...
@@ -63,6 +63,16 @@ jobs:
...
@@ -63,6 +63,16 @@ jobs:
flavor
:
|
flavor
:
|
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-${{ matrix.platform }}-
-
name
:
Build Docker image (latest)
-
name
:
Build Docker image (latest)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -72,8 +82,8 @@ jobs:
...
@@ -72,8 +82,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
-
name
:
Export digest
-
name
:
Export digest
run
:
|
run
:
|
...
@@ -123,7 +133,7 @@ jobs:
...
@@ -123,7 +133,7 @@ jobs:
username
:
${{ github.actor }}
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Extract metadata for Docker images (
default latest
tag)
-
name
:
Extract metadata for Docker images (
cuda
tag)
id
:
meta
id
:
meta
uses
:
docker/metadata-action@v5
uses
:
docker/metadata-action@v5
with
:
with
:
...
@@ -139,6 +149,16 @@ jobs:
...
@@ -139,6 +149,16 @@ jobs:
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
suffix=-cuda,onlatest=true
suffix=-cuda,onlatest=true
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-cuda-${{ matrix.platform }}-
-
name
:
Build Docker image (cuda)
-
name
:
Build Docker image (cuda)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -148,8 +168,8 @@ jobs:
...
@@ -148,8 +168,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
build-args
:
USE_CUDA=true
build-args
:
USE_CUDA=true
-
name
:
Export digest
-
name
:
Export digest
...
@@ -216,6 +236,16 @@ jobs:
...
@@ -216,6 +236,16 @@ jobs:
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
suffix=-ollama,onlatest=true
suffix=-ollama,onlatest=true
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-ollama-${{ matrix.platform }}-
-
name
:
Build Docker image (ollama)
-
name
:
Build Docker image (ollama)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -225,8 +255,8 @@ jobs:
...
@@ -225,8 +255,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
build-args
:
USE_OLLAMA=true
build-args
:
USE_OLLAMA=true
-
name
:
Export digest
-
name
:
Export digest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment