Skip to content

Commit

Permalink
try inline cache
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Aug 30, 2023
1 parent 6345aa4 commit e4b63af
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 e4b63af

Please sign in to comment.