Skip to content

Commit

Permalink
Revert "Avoid running executable to verify if docker is correctly ins…
Browse files Browse the repository at this point in the history
…talled and clarify documentation for `jib.dockerClient.executable` (#3742)" (#3743)

This reverts commit 0e731e2.
  • Loading branch information
mpeddada1 authored Aug 25, 2022
1 parent 0e731e2 commit 8e162a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public List<DescriptorDigest> getDiffIds() throws DigestException {
public static final Path DEFAULT_DOCKER_CLIENT = Paths.get("docker");

/**
* Checks if Docker is installed on the user's system by verifying if the executable path provided
* exists and the JVM has the appropriate permissions to execute it.
* Checks if Docker is installed on the user's system and accessible by running the default {@code
* docker} command.
*
* @return {@code true} if Docker is installed on the user's system and accessible
*/
Expand All @@ -113,14 +113,20 @@ public static boolean isDefaultDockerInstalled() {
}

/**
* Checks if Docker is installed on the user's system and by verifying if the executable path
* provided exists and the JVM has the appropriate permissions to execute it.
* Checks if Docker is installed on the user's system and accessible by running the given {@code
* docker} executable.
*
* @param dockerExecutable path to the executable to test running
* @return {@code true} if Docker is installed on the user's system and accessible
*/
public static boolean isDockerInstalled(Path dockerExecutable) {
return Files.isExecutable(dockerExecutable);
try {
new ProcessBuilder(dockerExecutable.toString()).start();
return true;

} catch (IOException ex) {
return false;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion jib-gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Property | Type | Default | Description

Property | Type | Default | Description
--- | --- | --- | ---
`executable` | `File` | `docker` | Sets the path to the Docker executable that is called to load the image into the Docker daemon. **Please note**: Users are responsible for ensuring that the Docker path passed in is valid and has the right permissions to be executed.
`executable` | `File` | `docker` | Sets the path to the Docker executable that is called to load the image into the Docker daemon.
`environment` | `Map<String, String>` | *None* | Sets environment variables used by the Docker executable.

#### System Properties
Expand Down
2 changes: 1 addition & 1 deletion jib-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Property | Type | Default | Description

Property | Type | Default | Description
--- | --- | --- | ---
`executable` | string | `docker` | Sets the path to the Docker executable that is called to load the image into the Docker daemon. **Please note**: Users are responsible for ensuring that the Docker path passed in is valid and has the right permissions to be executed.
`executable` | string | `docker` | Sets the path to the Docker executable that is called to load the image into the Docker daemon.
`environment` | map | *None* | Sets environment variables used by the Docker executable.

#### System Properties
Expand Down

0 comments on commit 8e162a2

Please sign in to comment.