Package com.google.cloud.tools.jib.api
Class Jib
- java.lang.Object
-
- com.google.cloud.tools.jib.api.Jib
-
public class Jib extends java.lang.Object
Build containers with Jib.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DOCKER_DAEMON_IMAGE_PREFIX
static java.lang.String
REGISTRY_IMAGE_PREFIX
static java.lang.String
TAR_IMAGE_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JibContainerBuilder
from(DockerClient dockerClient, DockerDaemonImage dockerDaemonImage)
Starts building the container from a base image stored in the Docker cache.static JibContainerBuilder
from(DockerDaemonImage dockerDaemonImage)
Starts building the container from a base image stored in the Docker cache.static JibContainerBuilder
from(ImageReference baseImageReference)
Starts building the container from a base image.static JibContainerBuilder
from(RegistryImage registryImage)
Starts building the container from a registry base image.static JibContainerBuilder
from(TarImage tarImage)
Starts building the container from a tarball.static JibContainerBuilder
from(java.lang.String baseImageReference)
Starts building the container from a base image.static JibContainerBuilder
fromScratch()
Starts building the container from an empty base image.
-
-
-
Field Detail
-
REGISTRY_IMAGE_PREFIX
public static final java.lang.String REGISTRY_IMAGE_PREFIX
- See Also:
- Constant Field Values
-
DOCKER_DAEMON_IMAGE_PREFIX
public static final java.lang.String DOCKER_DAEMON_IMAGE_PREFIX
- See Also:
- Constant Field Values
-
TAR_IMAGE_PREFIX
public static final java.lang.String TAR_IMAGE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
from
public static JibContainerBuilder from(java.lang.String baseImageReference) throws InvalidImageReferenceException
Starts building the container from a base image. The type of base image can be specified using a prefix, e.g.docker://gcr.io/project/image
. The available prefixes are described below:- No prefix, or
registry://
: uses a registry base image docker://
: uses a base image found in the local Docker daemontar://
: uses a tarball base image at the path following the prefix
- Parameters:
baseImageReference
- the base image reference- Returns:
- a new
JibContainerBuilder
to continue building the container - Throws:
InvalidImageReferenceException
- if thebaseImageReference
is not a valid image reference
- No prefix, or
-
from
public static JibContainerBuilder from(ImageReference baseImageReference)
Starts building the container from a base image. The base image should be publicly-available. For a base image that requires credentials, usefrom(RegistryImage)
.- Parameters:
baseImageReference
- the base image reference- Returns:
- a new
JibContainerBuilder
to continue building the container
-
from
public static JibContainerBuilder from(RegistryImage registryImage)
Starts building the container from a registry base image.- Parameters:
registryImage
- theRegistryImage
that defines base container registry and credentials- Returns:
- a new
JibContainerBuilder
to continue building the container
-
from
public static JibContainerBuilder from(DockerDaemonImage dockerDaemonImage)
Starts building the container from a base image stored in the Docker cache. Requires a running Docker daemon.- Parameters:
dockerDaemonImage
- theDockerDaemonImage
that defines the base image and Docker client- Returns:
- a new
JibContainerBuilder
to continue building the container
-
from
public static JibContainerBuilder from(TarImage tarImage)
Starts building the container from a tarball.- Parameters:
tarImage
- theTarImage
that defines the path to the base image- Returns:
- a new
JibContainerBuilder
to continue building the container
-
fromScratch
public static JibContainerBuilder fromScratch()
Starts building the container from an empty base image.- Returns:
- a new
JibContainerBuilder
to continue building the container
-
from
public static JibContainerBuilder from(DockerClient dockerClient, DockerDaemonImage dockerDaemonImage)
Starts building the container from a base image stored in the Docker cache. Requires a running Docker daemon.- Parameters:
dockerClient
- theDockerClient
to connectdockerDaemonImage
- theDockerDaemonImage
that defines the base image and Docker client- Returns:
- a new
JibContainerBuilder
to continue building the container
-
-