Skip to content

Commit

Permalink
Merge pull request #27 from deadsnakes/inline-cache
Browse files Browse the repository at this point in the history
try inline cache
  • Loading branch information
asottile authored Aug 30, 2023
2 parents 6345aa4 + e4b63af commit 39b0d71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/docker-build
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ def main() -> int:
for filename in os.listdir('dockerfiles'):
_, name = filename.split('.')
tag = f'ghcr.io/deadsnakes/{name}:latest'
tag_cache = f'{tag}-cache'
print(f' {tag} '.center(79, '='), flush=True)

if args.event == 'push':
extra: tuple[str, ...] = ('--cache-to', tag_cache, '--push')
extra: tuple[str, ...] = ('--push',)
else:
extra = ()

with open(os.path.join('dockerfiles', filename), 'rb') as f:
cmd = (
'docker', 'buildx', 'build',
'--pull',
'--cache-from', tag_cache,
'--cache-from', tag,
'--cache-to', 'type=inline',
'--tag', tag,
*extra,
'-',
Expand Down

0 comments on commit 39b0d71

Please sign in to comment.