code: def build_docker(ctx, image):
      
      if image not in DOCKER_IMGS:
          print('Error: unknown docker image "{0}"!'.format(image), file=sys.stderr)
          sys.exit(1)
  
      dinfo = DOCKER_IMGS[image]
      ctx.run('docker rmi -f {0}'.format(dinfo['name']), warn=True)
      dinfo_work_dir = os.path.join(dinfo['path'], '_work')
      ctx.run('mkdir -p {0}'.format(dinfo_work_dir))
      ctx.run('cp {0} {1}'.format(os.path.join(DOCKER_COMMON_DIR, 'sudo-as-user.sh'), dinfo_work_dir))
      ctx.run('docker build -t {0} {1}'.format(dinfo['name'], dinfo['path']))
docs: build docker images