VolumeArgs

data class VolumeArgs(val driver: Output<String>? = null, val driverOpts: Output<Map<String, Any>>? = null, val labels: Output<List<VolumeLabelArgs>>? = null, val name: Output<String>? = null) : ConvertibleToJava<VolumeArgs>

Creates and destroys a volume in Docker. This can be used alongside docker.Container to prepare volumes that can be shared across containers.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.docker.Volume;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sharedVolume = new Volume("sharedVolume");
}
}

Import

Example Assuming you created a volume as follows #!/bin/bash docker volume create prints the long ID 524b0457aa2a87dd2b75c74c3e4e53f406974249e63ab3ed9bf21e5644f9dc7d you provide the definition for the resource as follows terraform resource "docker_volume" "foo" {

name = "524b0457aa2a87dd2b75c74c3e4e53f406974249e63ab3ed9bf21e5644f9dc7d" } then the import command is as follows #!/bin/bash

$ pulumi import docker:index/volume:Volume foo 524b0457aa2a87dd2b75c74c3e4e53f406974249e63ab3ed9bf21e5644f9dc7d

Constructors

Link copied to clipboard
constructor(driver: Output<String>? = null, driverOpts: Output<Map<String, Any>>? = null, labels: Output<List<VolumeLabelArgs>>? = null, name: Output<String>? = null)

Properties

Link copied to clipboard
val driver: Output<String>? = null

Driver type for the volume. Defaults to local.

Link copied to clipboard
val driverOpts: Output<Map<String, Any>>? = null

Options specific to the driver.

Link copied to clipboard
val labels: Output<List<VolumeLabelArgs>>? = null

User-defined key/value metadata

Link copied to clipboard
val name: Output<String>? = null

The name of the Docker volume (will be generated if not provided).

Functions

Link copied to clipboard
open override fun toJava(): VolumeArgs