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.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.github.dockerjava.api.DockerClient;
|
||||
import com.github.dockerjava.api.command.BuildImageResultCallback;
|
||||
import com.github.dockerjava.api.command.CreateContainerResponse;
|
||||
@ -24,8 +25,7 @@ import com.github.dockerjava.transport.DockerHttpClient;
|
||||
public class Docker {
|
||||
|
||||
static DockerClientConfig DockerConfig = DefaultDockerClientConfig.createDefaultConfigBuilder()
|
||||
.withDockerHost("tcp://sweetsuse:2375")
|
||||
//.withDockerHost("tcp://sweetsuse:8085")
|
||||
.withDockerHost(DockerProperties.getEndpoint())
|
||||
.withDockerTlsVerify(false)
|
||||
.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": [{
|
||||
"name": "spring.datasource.jdbc-url",
|
||||
"type": "java.lang.String",
|
||||
"description": "New Hikari JDBC connection URI specifier"
|
||||
}]}
|
||||
{"properties": [
|
||||
{
|
||||
"name": "spring.datasource.jdbc-url",
|
||||
"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"
|
||||
}
|
||||
]}
|
||||
|
@ -10,4 +10,5 @@ spring.datasource.driverClassName=org.mariadb.jdbc.Driver
|
||||
spring.datasource.jdbc-url=jdbc:mariadb://${DB_HOST}/${DB}
|
||||
spring.datasource.username=${DB_USER}
|
||||
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