Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
naku committed Nov 25, 2024
1 parent f3e5cf0 commit ded6e54
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 14 deletions.
Empty file modified .github/workflows/build.yml
100755 → 100644
Empty file.
Empty file modified .gitignore
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions CHANGELOG.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Change Log
### Version 1.3.0 (2024-11-25)
- Add ability to connect through socket
### Version 1.2.0 (2020-12-28)
- Deploy using Github Action
### Version 1.1.0 (2019-05-03)
Expand Down
Empty file modified LICENSE
100755 → 100644
Empty file.
13 changes: 13 additions & 0 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ repositories:

#### Add the configuration to `application.conf`

```
docker.remote_host=yourdockerhost.com
docker.remote_port=2400
```

#### Connect with socket

```
docker.use_socket=true
```

#### Connect with certificate

```
docker.remote_host=yourdockerhost.com
docker.remote_port=2376
Expand Down
Empty file modified app/controllers/Dockers.java
100755 → 100644
Empty file.
33 changes: 20 additions & 13 deletions app/helpers/docker/DockerUtil.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.auth.FixedRegistryAuthSupplier;
import com.spotify.docker.client.messages.RegistryAuth;
import com.spotify.docker.client.messages.RegistryConfigs;
import play.Play;

import java.net.URI;
Expand All @@ -26,20 +25,24 @@ public class DockerUtil {
public static DockerClient createDockerClient() {
try {
DefaultDockerClient.Builder builder = DefaultDockerClient.builder();
if (getDockerCertDir() != null) {
builder
.uri(URI.create("https://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2376")))
.dockerCertificates(DockerCertificates.builder()
.dockerCertPath(Paths.get(getDockerCertDir()))
.build().orNull());
if (isUseSocket()) {
builder.uri(URI.create("unix:///var/run/docker.sock"));
} else {
builder.uri(URI.create("http://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2400")));
if (getDockerAuthorization() != null) {
builder.header("Authorization", "Basic " + getDockerAuthorization());
if (getDockerCertDir() != null) {
builder
.uri(URI.create("https://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2376")))
.dockerCertificates(DockerCertificates.builder()
.dockerCertPath(Paths.get(getDockerCertDir()))
.build().orNull());
} else {
builder.uri(URI.create("http://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2400")));
if (getDockerAuthorization() != null) {
builder.header("Authorization", "Basic " + getDockerAuthorization());
}
}
if (getRegistryUsername() != null && getRegistryPassword() != null && getRegistryAddress() != null) {
builder.registryAuthSupplier(new FixedRegistryAuthSupplier(getRegistryAuth(), null));
}
}
if (getRegistryUsername() != null && getRegistryPassword() != null && getRegistryAddress() != null) {
builder.registryAuthSupplier(new FixedRegistryAuthSupplier(getRegistryAuth(), null));
}
return builder.build();
} catch (Exception e) {
Expand Down Expand Up @@ -67,6 +70,10 @@ private static String getDockerRemotePort(String defaultPort) {
return Play.configuration.getProperty("docker.remote_port", defaultPort);
}

private static boolean isUseSocket() {
return Boolean.getBoolean(Play.configuration.getProperty("docker.use_socket"));
}

private static String getDockerAuthorization() {
return Play.configuration.getProperty("docker.authorization");
}
Expand Down
Empty file modified app/play.plugins
100755 → 100644
Empty file.
Empty file modified app/plugins/docker/DockerPlugin.java
100755 → 100644
Empty file.
Empty file modified app/views/Dockers/index.html
100755 → 100644
Empty file.
Empty file modified build.xml
100755 → 100644
Empty file.
Empty file modified commands.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion conf/dependencies.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
self: play -> docker 1.2.0
self: play -> docker 1.3.0

configurations:
- provided:
Expand Down
Empty file modified conf/messages
100755 → 100644
Empty file.
Empty file modified conf/routes
100755 → 100644
Empty file.

0 comments on commit ded6e54

Please sign in to comment.