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

com.github.dockerjava.api.model.SELContext Maven / Gradle / Ivy

There is a newer version: 3.4.0_1
Show newest version
package com.github.dockerjava.api.model;

/**
 * The context mode of bound volume in SELinux.
 * Host path shared - can be used by all containers, private - by only this container
 *
 * @see http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/
 * @since 1.17
 */
public enum SELContext {
    /** no selinux */
    none(""),

    /** z option */
    shared("z"),

    /** Z option */
    single("Z");

    /**
     * The default {@link SELContext}: {@link #none}
     */
    public static final SELContext DEFAULT = none;

    private String value;

    SELContext(String v) {
        this.value = v;
    }

    @Override
    public String toString() {
        return value;
    }

    public static SELContext fromString(String p) {
        switch (p) {
        case "z":
            return shared;
        case "Z":
            return single;
        }
        return none;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy