@@ -95,10 +95,10 @@ public DockerClient(@Nonnull Launcher launcher, @CheckForNull Node node, @CheckF
95
95
* @param volumesFromContainers Mounts all volumes from the given containers.
96
96
* @param containerEnv Environment variables to set in container.
97
97
* @param user The <strong>uid:gid</strong> to execute the container command as. Use {@link #whoAmI()}.
98
- * @param entrypoint The command to execute in the image container being run.
98
+ * @param command The command to execute in the image container being run.
99
99
* @return The container ID.
100
100
*/
101
- public String run (@ Nonnull EnvVars launchEnv , @ Nonnull String image , @ CheckForNull String args , @ CheckForNull String workdir , @ Nonnull Map <String , String > volumes , @ Nonnull Collection <String > volumesFromContainers , @ Nonnull EnvVars containerEnv , @ Nonnull String user , @ Nonnull String entrypoint ) throws IOException , InterruptedException {
101
+ public String run (@ Nonnull EnvVars launchEnv , @ Nonnull String image , @ CheckForNull String args , @ CheckForNull String workdir , @ Nonnull Map <String , String > volumes , @ Nonnull Collection <String > volumesFromContainers , @ Nonnull EnvVars containerEnv , @ Nonnull String user , @ CheckForNull String ... command ) throws IOException , InterruptedException {
102
102
ArgumentListBuilder argb = new ArgumentListBuilder ();
103
103
104
104
argb .add ("run" , "-t" , "-d" , "-u" , user );
@@ -119,7 +119,9 @@ public String run(@Nonnull EnvVars launchEnv, @Nonnull String image, @CheckForNu
119
119
argb .add ("-e" );
120
120
argb .addMasked (variable .getKey ()+"=" +variable .getValue ());
121
121
}
122
- argb .add ("--entrypoint" ).add (entrypoint ).add (image );
122
+ if (command != null ) {
123
+ argb .add (image ).add (command );
124
+ }
123
125
124
126
LaunchResult result = launch (launchEnv , false , null , argb );
125
127
if (result .getStatus () == 0 ) {
0 commit comments