Stop using some context managers that we don't need.
@@ -59,15 +59,16 @@ def main():
target_image = docker_name.Tag(args.name)
target_creds = docker_creds.DefaultKeychain.Resolve(target_image)
- with context.Workspace(args.directory) as ctx:
- with cache.Registry(
+ ctx = context.Workspace(args.directory)
+ cash = cache.Registry(
target_image.as_repository(),
target_creds,
transport,
threads=_THREADS,
- mount=[base_name]) as cash:
- with builder.From(ctx) as bldr:
- with docker_image.FromRegistry(base_name, base_creds,
+ mount=[base_name])
+ bldr = builder.From(ctx)
+ with docker_image.FromRegistry(base_name,
+ base_creds,
transport) as base_image:
# Create (or pull from cache) the base image with the
@@ -77,8 +78,7 @@ def main():
# Construct the application layer from the context.
logging.info('Generating app layer...')
app_layer, diff_id = bldr.BuildAppLayer()
- with append.Layer(
- deps, app_layer, diff_id=diff_id) as app_image:
+ with append.Layer(deps, app_layer, diff_id=diff_id) as app_image:
with docker_session.Push(
target_image,
target_creds,
