Create a new project.

def create(name, image, bare):
    """
    Create a new project.
    """
    if bool(bare) == bool(image):
        raise click.UsageError("Specify either --bare or image using --image.")

    path = get_project_path(name)

    print("Creating %s..." % path)
    try:
        os.mkdir(path)
    except FileExistsError:
        die("%s already exists." % path)

    if not bare:
        print("Creating container with image %s..." % image)
        client = docker.Client()
        try:
            client.create_container(
                image=image,
                name=get_container_name(name),
                hostname=name,
                working_dir='/code/',
                command='tail -f /dev/null',
                tty=True,
                volumes=['/code/'],
                host_config=client.create_host_config(binds={
                    path: {'bind': '/code/', 'mode': 'rw'}
                })
            )
        except docker.errors.APIError as error:
            die(error.explanation.decode())

    enter_project(name)