Class DockerRegistryEndpoint
java.lang.Object
hudson.model.AbstractDescribableImpl<DockerRegistryEndpoint>
org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint
- All Implemented Interfaces:
Describable<DockerRegistryEndpoint>
Encapsulates the endpoint of DockerHub and how to interact with it.
As Describable
it comes with pre-baked configuration form that you can use in
your builders/publishers/etc that interact with Docker daemon.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static DockerRegistryEndpoint
fromImageName
(String s, String credentialsId) Parse the registry endpoint out of a registry:port/namespace/name:tag string as created byimageName(String)
.ID of the credentials used to talk to this endpoint.Gets the endpoint URL, such as "https://index.docker.io/v1/"Deprecated.getUrl()
For stapler.int
hashCode()
Decorates the repository ID namespace/name (ie.newKeyMaterialFactory
(Item context, FilePath workspace, Launcher launcher, EnvVars env, TaskListener listener, String dockerExecutable) newKeyMaterialFactory
(Item context, FilePath workspace, Launcher launcher, TaskListener listener, String dockerExecutable) newKeyMaterialFactory
(Item context, hudson.remoting.VirtualChannel target) newKeyMaterialFactory
(Item context, hudson.remoting.VirtualChannel target, Launcher launcher, TaskListener listener) newKeyMaterialFactory
(Run context, FilePath workspace, Launcher launcher, EnvVars env, TaskListener listener, String dockerExecutable) Makes the credentials available locally and returnsKeyMaterialFactory
that gives you the parameters needed to access it.toString()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
DockerRegistryEndpoint
-
-
Method Details
-
fromImageName
Parse the registry endpoint out of a registry:port/namespace/name:tag string as created byimageName(String)
. Credentials are set to the id passed. The url is built from registry:port into https://registry:port, the same way docker push does.- Parameters:
s
-credentialsId
- passed to the constructor, can be null- Returns:
- The DockerRegistryEndpoint corresponding to the registry:port part of the string
- Throws:
IllegalArgumentException
- if string can't be parsed
-
getEffectiveUrl
Gets the endpoint URL, such as "https://index.docker.io/v1/"- Throws:
IOException
-
getUrl
For stapler. -
getCredentialsId
ID of the credentials used to talk to this endpoint. -
getToken
Deprecated.CallgetToken(Run)
Plugins that want to refer to aIdCredentials
should do so via ID string, and use this method to resolve it and convert toDockerRegistryToken
. Implements the logicCredentialsProvider.findCredentialById(String, Class, Run, DomainRequirement...)
but for anItem
.- Parameters:
context
- If you are a build step trying to access DockerHub in the context of a build/job, specify that job. Otherwise null. If you are scoped to something else, you might have to interact withCredentialsProvider
directly.
-
newKeyMaterialFactory
@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@NonNull AbstractBuild build) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
newKeyMaterialFactory
@Deprecated public KeyMaterialFactory newKeyMaterialFactory(Item context, @NonNull hudson.remoting.VirtualChannel target) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
newKeyMaterialFactory
@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull Item context, @NonNull hudson.remoting.VirtualChannel target, @CheckForNull Launcher launcher, @NonNull TaskListener listener) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
newKeyMaterialFactory
@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull Item context, @NonNull FilePath workspace, @NonNull Launcher launcher, @NonNull TaskListener listener, @NonNull String dockerExecutable) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
newKeyMaterialFactory
@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull Item context, @NonNull FilePath workspace, @NonNull Launcher launcher, @NonNull EnvVars env, @NonNull TaskListener listener, @NonNull String dockerExecutable) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
newKeyMaterialFactory
public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull Run context, @NonNull FilePath workspace, @NonNull Launcher launcher, @NonNull EnvVars env, @NonNull TaskListener listener, @NonNull String dockerExecutable) throws IOException, InterruptedException Makes the credentials available locally and returnsKeyMaterialFactory
that gives you the parameters needed to access it.- Parameters:
context
- The build trying to access DockerHubworkspace
- a workspace being used for operations (WorkspaceList.tempDir(hudson.FilePath)
will be applied)dockerExecutable
- as inDockerTool.getExecutable(java.lang.String, hudson.model.Node, hudson.model.TaskListener, hudson.EnvVars)
, with a 1.8+ client- Throws:
IOException
InterruptedException
-
imageName
Decorates the repository ID namespace/name (ie. "jenkinsci/workflow-demo") with registry prefix (docker.acme.com:80/jenkinsci/workflow-demo).- Parameters:
userAndRepo
- the namespace/name part to append to the registry- Returns:
- the full registry:port/namespace/name string
- Throws:
IOException
-
toString
-
hashCode
public int hashCode() -
equals
-
getToken(Run)