code: func createVolumeWithData(cli *client.Client, volumeName string, data map[string][]byte, image string) error {
  	_, err := cli.VolumeCreate(context.Background(),
  		volume.VolumeCreateBody{
  			Driver: "local",
  			Name:   volumeName,
  		})
  	if err != nil {
  		return err
  	}
  	mnt := "/mnt"
  	miniContainer, err := cli.ContainerCreate(context.Background(),
  		&container.Config{
  			Image: image,
  		},
  		&container.HostConfig{
  			Mounts: []mount.Mount{
  				{
  					Type:   mount.TypeVolume,
  					Source: volumeName,
  					Target: mnt,
  				},
  			},
  		}, nil, "")
  	if err != nil {
  		return err
  	}
  	tr, err := createTar(data)
  	if err != nil {
  		return err
  	}
  	if cli.CopyToContainer(context.Background(),
  		miniContainer.ID, mnt, tr, types.CopyToContainerOptions{}); err != nil {
  		return err
  	}
  	return cli.ContainerRemove(context.Background(),
  		miniContainer.ID,
  		types.ContainerRemoveOptions{})
  }
docs: // createVolumeWithData creates a volume with the given data (e.g. data["/foo"] = []byte("bar"))
  // Internally, a container is created from the image so as to provision the data to the volume,
  // which is attached to the container.