All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.maven.docker.config.DockerMachineConfiguration Maven / Gradle / Ivy

There is a newer version: 0.45.0
Show newest version
package io.fabric8.maven.docker.config;

import java.io.Serializable;
import java.util.Map;

import org.apache.maven.plugins.annotations.Parameter;

public class DockerMachineConfiguration implements Serializable {

    public static final String DOCKER_MACHINE_NAME_PROP = "docker.machine.name";
    public static final String DOCKER_MACHINE_AUTO_CREATE_PROP = "docker.machine.autoCreate";

    /**
     * Name of the docker-machine
     */
    @Parameter
    private String name = "default";

    /**
     * Should the docker-machine be created if it does not exist?
     */
    @Parameter
    private Boolean autoCreate = Boolean.FALSE;

    /**
     * When creating a docker-machine, the map of createOptions for the driver.
     * Do not include the '--' portion of the option name.  For options without values, leave the value text empty.
     * e.g. --virtualbox-cpu-count 1 --virtualbox-no-share would be written as:
     * <virtualbox-cpu-count>1</virtualbox-cpu-count>
     * <virtualbox-no-share/>
     * 
     */
    @Parameter
    private Map createOptions;

    public DockerMachineConfiguration() {}

    public DockerMachineConfiguration(String name, String autoCreate) {
        this.name = name;
        this.autoCreate = autoCreate != null ? Boolean.parseBoolean(autoCreate) : Boolean.FALSE;
    }

    public String getName() {
        return name;
    }

    public Boolean getAutoCreate() {
        return autoCreate;
    }

    public Map getCreateOptions() {
        return createOptions;
    }

    @Override
    public String toString() {
        return "MachineConfiguration [name=" + name + ", autoCreate=" + autoCreate + ", createOptions=" + createOptions + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy