Class LinuxSecurityContext.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • runAsUser

        public LinuxSecurityContext.Builder runAsUser​(Integer runAsUser)
        The user ID (UID) to run the entrypoint process of the container.

        Defaults to user specified UID in container image metadata if not provided. This must be provided if runAsGroup is provided.

        Parameters:
        runAsUser - the value to set
        Returns:
        this builder
      • runAsGroup

        public LinuxSecurityContext.Builder runAsGroup​(Integer runAsGroup)
        The group ID (GID) to run the entrypoint process of the container.

        Uses runtime default if not provided.

        Parameters:
        runAsGroup - the value to set
        Returns:
        this builder
      • isNonRootUserCheckEnabled

        public LinuxSecurityContext.Builder isNonRootUserCheckEnabled​(Boolean isNonRootUserCheckEnabled)
        Indicates if the container must run as a non-root user.

        If true, the service validates the container image at runtime to ensure that it is not going to run with UID 0 (root) and fails the container instance creation if the validation fails.

        Parameters:
        isNonRootUserCheckEnabled - the value to set
        Returns:
        this builder
      • isRootFileSystemReadonly

        public LinuxSecurityContext.Builder isRootFileSystemReadonly​(Boolean isRootFileSystemReadonly)
        Determines if the container will have a read-only root file system.

        Default value is false.

        Parameters:
        isRootFileSystemReadonly - the value to set
        Returns:
        this builder