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

com.pulumi.docker.inputs.DockerBuildArgs Maven / Gradle / Ivy

There is a newer version: 4.7.0-alpha.1705607229+34a07055
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.docker.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.docker.enums.BuilderVersion;
import com.pulumi.docker.inputs.CacheFromArgs;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * The Docker build context
 * 
 */
public final class DockerBuildArgs extends com.pulumi.resources.ResourceArgs {

    public static final DockerBuildArgs Empty = new DockerBuildArgs();

    /**
     * Custom host-to-IP mappings to use while building (format: "host:ip")
     * 
     */
    @Import(name="addHosts")
    private @Nullable Output> addHosts;

    /**
     * @return Custom host-to-IP mappings to use while building (format: "host:ip")
     * 
     */
    public Optional>> addHosts() {
        return Optional.ofNullable(this.addHosts);
    }

    /**
     * An optional map of named build-time argument variables to set during the Docker build. This flag allows you to pass build-time variables that can be accessed like environment variables inside the RUN instruction.
     * 
     */
    @Import(name="args")
    private @Nullable Output> args;

    /**
     * @return An optional map of named build-time argument variables to set during the Docker build. This flag allows you to pass build-time variables that can be accessed like environment variables inside the RUN instruction.
     * 
     */
    public Optional>> args() {
        return Optional.ofNullable(this.args);
    }

    /**
     * The version of the Docker builder.
     * 
     */
    @Import(name="builderVersion")
    private @Nullable Output builderVersion;

    /**
     * @return The version of the Docker builder.
     * 
     */
    public Optional> builderVersion() {
        return Optional.ofNullable(this.builderVersion);
    }

    /**
     * A list of image names to use as build cache. Images provided must have a cache manifest. Must provide authentication to cache registry.
     * 
     */
    @Import(name="cacheFrom")
    private @Nullable Output cacheFrom;

    /**
     * @return A list of image names to use as build cache. Images provided must have a cache manifest. Must provide authentication to cache registry.
     * 
     */
    public Optional> cacheFrom() {
        return Optional.ofNullable(this.cacheFrom);
    }

    /**
     * The path to the build context to use.
     * 
     */
    @Import(name="context")
    private @Nullable Output context;

    /**
     * @return The path to the build context to use.
     * 
     */
    public Optional> context() {
        return Optional.ofNullable(this.context);
    }

    /**
     * The path to the Dockerfile to use.
     * 
     */
    @Import(name="dockerfile")
    private @Nullable Output dockerfile;

    /**
     * @return The path to the Dockerfile to use.
     * 
     */
    public Optional> dockerfile() {
        return Optional.ofNullable(this.dockerfile);
    }

    /**
     * Set the networking mode for RUN instructions
     * 
     */
    @Import(name="network")
    private @Nullable Output network;

    /**
     * @return Set the networking mode for RUN instructions
     * 
     */
    public Optional> network() {
        return Optional.ofNullable(this.network);
    }

    /**
     * The architecture of the platform you want to build this image for, e.g. `linux/arm64`.
     * 
     */
    @Import(name="platform")
    private @Nullable Output platform;

    /**
     * @return The architecture of the platform you want to build this image for, e.g. `linux/arm64`.
     * 
     */
    public Optional> platform() {
        return Optional.ofNullable(this.platform);
    }

    /**
     * The target of the Dockerfile to build
     * 
     */
    @Import(name="target")
    private @Nullable Output target;

    /**
     * @return The target of the Dockerfile to build
     * 
     */
    public Optional> target() {
        return Optional.ofNullable(this.target);
    }

    private DockerBuildArgs() {}

    private DockerBuildArgs(DockerBuildArgs $) {
        this.addHosts = $.addHosts;
        this.args = $.args;
        this.builderVersion = $.builderVersion;
        this.cacheFrom = $.cacheFrom;
        this.context = $.context;
        this.dockerfile = $.dockerfile;
        this.network = $.network;
        this.platform = $.platform;
        this.target = $.target;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(DockerBuildArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private DockerBuildArgs $;

        public Builder() {
            $ = new DockerBuildArgs();
        }

        public Builder(DockerBuildArgs defaults) {
            $ = new DockerBuildArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param addHosts Custom host-to-IP mappings to use while building (format: "host:ip")
         * 
         * @return builder
         * 
         */
        public Builder addHosts(@Nullable Output> addHosts) {
            $.addHosts = addHosts;
            return this;
        }

        /**
         * @param addHosts Custom host-to-IP mappings to use while building (format: "host:ip")
         * 
         * @return builder
         * 
         */
        public Builder addHosts(List addHosts) {
            return addHosts(Output.of(addHosts));
        }

        /**
         * @param addHosts Custom host-to-IP mappings to use while building (format: "host:ip")
         * 
         * @return builder
         * 
         */
        public Builder addHosts(String... addHosts) {
            return addHosts(List.of(addHosts));
        }

        /**
         * @param args An optional map of named build-time argument variables to set during the Docker build. This flag allows you to pass build-time variables that can be accessed like environment variables inside the RUN instruction.
         * 
         * @return builder
         * 
         */
        public Builder args(@Nullable Output> args) {
            $.args = args;
            return this;
        }

        /**
         * @param args An optional map of named build-time argument variables to set during the Docker build. This flag allows you to pass build-time variables that can be accessed like environment variables inside the RUN instruction.
         * 
         * @return builder
         * 
         */
        public Builder args(Map args) {
            return args(Output.of(args));
        }

        /**
         * @param builderVersion The version of the Docker builder.
         * 
         * @return builder
         * 
         */
        public Builder builderVersion(@Nullable Output builderVersion) {
            $.builderVersion = builderVersion;
            return this;
        }

        /**
         * @param builderVersion The version of the Docker builder.
         * 
         * @return builder
         * 
         */
        public Builder builderVersion(BuilderVersion builderVersion) {
            return builderVersion(Output.of(builderVersion));
        }

        /**
         * @param cacheFrom A list of image names to use as build cache. Images provided must have a cache manifest. Must provide authentication to cache registry.
         * 
         * @return builder
         * 
         */
        public Builder cacheFrom(@Nullable Output cacheFrom) {
            $.cacheFrom = cacheFrom;
            return this;
        }

        /**
         * @param cacheFrom A list of image names to use as build cache. Images provided must have a cache manifest. Must provide authentication to cache registry.
         * 
         * @return builder
         * 
         */
        public Builder cacheFrom(CacheFromArgs cacheFrom) {
            return cacheFrom(Output.of(cacheFrom));
        }

        /**
         * @param context The path to the build context to use.
         * 
         * @return builder
         * 
         */
        public Builder context(@Nullable Output context) {
            $.context = context;
            return this;
        }

        /**
         * @param context The path to the build context to use.
         * 
         * @return builder
         * 
         */
        public Builder context(String context) {
            return context(Output.of(context));
        }

        /**
         * @param dockerfile The path to the Dockerfile to use.
         * 
         * @return builder
         * 
         */
        public Builder dockerfile(@Nullable Output dockerfile) {
            $.dockerfile = dockerfile;
            return this;
        }

        /**
         * @param dockerfile The path to the Dockerfile to use.
         * 
         * @return builder
         * 
         */
        public Builder dockerfile(String dockerfile) {
            return dockerfile(Output.of(dockerfile));
        }

        /**
         * @param network Set the networking mode for RUN instructions
         * 
         * @return builder
         * 
         */
        public Builder network(@Nullable Output network) {
            $.network = network;
            return this;
        }

        /**
         * @param network Set the networking mode for RUN instructions
         * 
         * @return builder
         * 
         */
        public Builder network(String network) {
            return network(Output.of(network));
        }

        /**
         * @param platform The architecture of the platform you want to build this image for, e.g. `linux/arm64`.
         * 
         * @return builder
         * 
         */
        public Builder platform(@Nullable Output platform) {
            $.platform = platform;
            return this;
        }

        /**
         * @param platform The architecture of the platform you want to build this image for, e.g. `linux/arm64`.
         * 
         * @return builder
         * 
         */
        public Builder platform(String platform) {
            return platform(Output.of(platform));
        }

        /**
         * @param target The target of the Dockerfile to build
         * 
         * @return builder
         * 
         */
        public Builder target(@Nullable Output target) {
            $.target = target;
            return this;
        }

        /**
         * @param target The target of the Dockerfile to build
         * 
         * @return builder
         * 
         */
        public Builder target(String target) {
            return target(Output.of(target));
        }

        public DockerBuildArgs build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy