Move Docker/Podman endpoint to application.properties
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
ddce359812
commit
e724d7fd9e
@ -8,6 +8,7 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.github.dockerjava.api.DockerClient;
|
import com.github.dockerjava.api.DockerClient;
|
||||||
import com.github.dockerjava.api.command.BuildImageResultCallback;
|
import com.github.dockerjava.api.command.BuildImageResultCallback;
|
||||||
import com.github.dockerjava.api.command.CreateContainerResponse;
|
import com.github.dockerjava.api.command.CreateContainerResponse;
|
||||||
@ -24,8 +25,7 @@ import com.github.dockerjava.transport.DockerHttpClient;
|
|||||||
public class Docker {
|
public class Docker {
|
||||||
|
|
||||||
static DockerClientConfig DockerConfig = DefaultDockerClientConfig.createDefaultConfigBuilder()
|
static DockerClientConfig DockerConfig = DefaultDockerClientConfig.createDefaultConfigBuilder()
|
||||||
.withDockerHost("tcp://sweetsuse:2375")
|
.withDockerHost(DockerProperties.getEndpoint())
|
||||||
//.withDockerHost("tcp://sweetsuse:8085")
|
|
||||||
.withDockerTlsVerify(false)
|
.withDockerTlsVerify(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package net.libertacasa.pubsh.web;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("lysergic.docker")
|
||||||
|
public class DockerProperties {
|
||||||
|
|
||||||
|
private static String endpoint;
|
||||||
|
|
||||||
|
public void setEndpoint(String endpoint) {
|
||||||
|
DockerProperties.endpoint = endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getEndpoint() {
|
||||||
|
return endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,12 @@
|
|||||||
{"properties": [{
|
{"properties": [
|
||||||
"name": "spring.datasource.jdbc-url",
|
{
|
||||||
"type": "java.lang.String",
|
"name": "spring.datasource.jdbc-url",
|
||||||
"description": "New Hikari JDBC connection URI specifier"
|
"type": "java.lang.String",
|
||||||
}]}
|
"description": "New Hikari JDBC connection URI specifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lysergic.docker.endpoint",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Custom variable to specify Docker/Podman API endpoint"
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
@ -11,3 +11,4 @@ spring.datasource.jdbc-url=jdbc:mariadb://${DB_HOST}/${DB}
|
|||||||
spring.datasource.username=${DB_USER}
|
spring.datasource.username=${DB_USER}
|
||||||
spring.datasource.password=${DB_SECRET}
|
spring.datasource.password=${DB_SECRET}
|
||||||
db-scheduler.enabled=true
|
db-scheduler.enabled=true
|
||||||
|
lysergic.docker.endpoint=${CONTAINER_API}
|
Loading…
Reference in New Issue
Block a user