Skip to content

Commit c851b82

Browse files
committed
Add WSL auto-setup and remove Javadocs
1 parent e925e53 commit c851b82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+296
-755
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies {
2828

2929
test {
3030
useJUnitPlatform()
31+
onlyIf { gradle.startParameter.taskNames.any { it == 'test' || it == ':test' } }
3132
}
3233

3334
java {

src/main/java/io/github/intisy/docker/DockerClient.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@
2121
* .withHost("unix:///var/run/docker.sock")
2222
* .build();
2323
*
24-
* // List containers
25-
* List<Container> containers = client.listContainers().withShowAll(true).exec();
26-
*
27-
* // Pull and run a container
28-
* client.pullImage("nginx:alpine").exec(5, TimeUnit.MINUTES);
29-
* CreateContainerResponse response = client.createContainer("nginx:alpine")
30-
* .withName("my-nginx")
31-
* .exec();
32-
* client.startContainer(response.getId()).exec();
33-
*
34-
* // Clean up
35-
* client.stopContainer(response.getId()).exec();
36-
* client.removeContainer(response.getId()).exec();
37-
* }</pre>
38-
*
3924
* @author Finn Birich
4025
*/
4126
public class DockerClient implements Closeable {
@@ -60,8 +45,6 @@ public static DockerClient createDefault() {
6045
}
6146
}
6247

63-
// ==================== Container Commands ====================
64-
6548
public ListContainersCmd listContainers() {
6649
return new ListContainersCmd(httpClient);
6750
}
@@ -122,8 +105,6 @@ public ExecInspectCmd execInspect(String execId) {
122105
return new ExecInspectCmd(httpClient, execId);
123106
}
124107

125-
// ==================== Image Commands ====================
126-
127108
public ListImagesCmd listImages() {
128109
return new ListImagesCmd(httpClient);
129110
}
@@ -148,8 +129,6 @@ public BuildImageCmd buildImage() {
148129
return new BuildImageCmd(httpClient);
149130
}
150131

151-
// ==================== Volume Commands ====================
152-
153132
public ListVolumesCmd listVolumes() {
154133
return new ListVolumesCmd(httpClient);
155134
}
@@ -166,8 +145,6 @@ public InspectVolumeCmd inspectVolume(String volumeName) {
166145
return new InspectVolumeCmd(httpClient, volumeName);
167146
}
168147

169-
// ==================== Network Commands ====================
170-
171148
public ListNetworksCmd listNetworks() {
172149
return new ListNetworksCmd(httpClient);
173150
}
@@ -192,8 +169,6 @@ public DisconnectNetworkCmd disconnectNetwork(String networkId) {
192169
return new DisconnectNetworkCmd(httpClient, networkId);
193170
}
194171

195-
// ==================== System Commands ====================
196-
197172
public PingCmd ping() {
198173
return new PingCmd(httpClient);
199174
}

src/main/java/io/github/intisy/docker/DockerProvider.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ public static void resetBaseDirectory() {
8888
@Deprecated
8989
protected static final Path DOCKER_DIR = DEFAULT_DOCKER_DIR;
9090

91-
/**
92-
* Get the appropriate DockerProvider for the current operating system.
93-
*/
9491
public static DockerProvider get() {
9592
String os = System.getProperty("os.name").toLowerCase();
9693
if (os.contains("win")) {

src/main/java/io/github/intisy/docker/DockerVersionFetcher.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import java.net.URL;
1212

1313
/**
14-
* Fetches the latest Docker version from GitHub.
15-
*
1614
* @author Finn Birich
1715
*/
1816
public class DockerVersionFetcher {
@@ -49,9 +47,6 @@ public static String getLatestVersion() {
4947
return latestVersion;
5048
}
5149

52-
/**
53-
* Reset the cached version (useful for testing).
54-
*/
5550
public static void resetCache() {
5651
latestVersion = null;
5752
}

src/main/java/io/github/intisy/docker/IOUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import java.io.InputStream;
66

77
/**
8-
* I/O utility methods for Java 8 compatibility.
9-
*
108
* @author Finn Birich
119
*/
1210
final class IOUtils {

src/main/java/io/github/intisy/docker/MacDockerProvider.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ private boolean isLimaInstalled() {
129129
}
130130
}
131131

132-
/**
133-
* Download and install Lima from GitHub releases.
134-
*/
135132
@SuppressWarnings("deprecation")
136133
private void downloadAndInstallLima() throws IOException {
137134
String arch = getArch();
@@ -182,9 +179,6 @@ private void downloadAndInstallLima() throws IOException {
182179
log.info("Lima {} installed successfully", LIMA_VERSION);
183180
}
184181

185-
/**
186-
* Get the architecture string for Lima download.
187-
*/
188182
private String getArch() {
189183
String osArch = System.getProperty("os.arch");
190184
switch (osArch) {
@@ -219,9 +213,6 @@ public void start() throws IOException, InterruptedException {
219213
log.info("Docker daemon started in Lima VM (instance: {}, port: {})", instanceId, dockerPort);
220214
}
221215

222-
/**
223-
* Create and start a Lima VM configured for Docker.
224-
*/
225216
private void createAndStartLimaVm() throws IOException, InterruptedException {
226217
String limactl = getLimactlPath();
227218

@@ -270,9 +261,6 @@ private void createAndStartLimaVm() throws IOException, InterruptedException {
270261
ensureDockerRunning();
271262
}
272263

273-
/**
274-
* Create Lima configuration YAML for Docker.
275-
*/
276264
private String createLimaConfig() {
277265
return String.format(
278266
"# Lima VM configuration for docker-java\n" +
@@ -357,9 +345,6 @@ private void ensureDockerRunning() throws IOException, InterruptedException {
357345
}
358346
}
359347

360-
/**
361-
* Run a Lima shell command in the VM.
362-
*/
363348
private String runLimaShellCommand(String command) throws IOException, InterruptedException {
364349
String limactl = getLimactlPath();
365350
ProcessBuilder pb = new ProcessBuilder(limactl, "shell", vmName, "bash", "-c", command);
@@ -370,9 +355,6 @@ private String runLimaShellCommand(String command) throws IOException, Interrupt
370355
return new String(output).trim();
371356
}
372357

373-
/**
374-
* Run a limactl command.
375-
*/
376358
private String runLimaCommand(String... command) throws IOException, InterruptedException {
377359
ProcessBuilder pb = new ProcessBuilder(command);
378360
pb.redirectErrorStream(true);
@@ -382,9 +364,6 @@ private String runLimaCommand(String... command) throws IOException, Interrupted
382364
return new String(output).trim();
383365
}
384366

385-
/**
386-
* Get Lima VM logs for debugging.
387-
*/
388367
private String getLimaLogs() {
389368
try {
390369
return runLimaShellCommand("sudo journalctl -u docker --no-pager -n 50 2>/dev/null || cat /var/log/docker.log 2>/dev/null || echo 'No logs available'");
@@ -393,9 +372,6 @@ private String getLimaLogs() {
393372
}
394373
}
395374

396-
/**
397-
* Wait for Docker to be accessible.
398-
*/
399375
private boolean waitForDocker() throws InterruptedException {
400376
log.debug("Waiting for Docker daemon on localhost:{}...", dockerPort);
401377
long timeoutMillis = TimeUnit.SECONDS.toMillis(120);

0 commit comments

Comments
 (0)