Skip to content

Commit fcf5dc4

Browse files
committed
Upgrade to non-ancient version of docker-client.
1 parent 95f00e1 commit fcf5dc4

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,19 @@
763763
<version>0.10</version>
764764
<scope>test</scope>
765765
</dependency>
766+
<dependency>
767+
<groupId>com.spotify</groupId>
768+
<artifactId>docker-client</artifactId>
769+
<classifier>shaded</classifier>
770+
<version>3.1.10</version>
771+
<scope>test</scope>
772+
<exclusions>
773+
<exclusion>
774+
<artifactId>guava</artifactId>
775+
<groupId>com.google.guava</groupId>
776+
</exclusion>
777+
</exclusions>
778+
</dependency>
766779
<dependency>
767780
<groupId>org.apache.curator</groupId>
768781
<artifactId>curator-recipes</artifactId>

sql/core/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,7 @@
115115
<groupId>com.spotify</groupId>
116116
<artifactId>docker-client</artifactId>
117117
<classifier>shaded</classifier>
118-
<version>2.7.7</version>
119118
<scope>test</scope>
120-
<exclusions>
121-
<exclusion>
122-
<artifactId>guava</artifactId>
123-
<groupId>com.google.guava</groupId>
124-
</exclusion>
125-
</exclusions>
126119
</dependency>
127120
</dependencies>
128121
<build>

sql/core/src/test/scala/org/apache/spark/sql/jdbc/DockerJDBCIntegrationSuite.scala

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ abstract class DockerJDBCIntegrationSuite
8989
log.warn(s"Docker image ${db.imageName} not found; pulling image from registry")
9090
docker.pull(db.imageName)
9191
}
92-
// Create the database container:
93-
val config = ContainerConfig.builder()
94-
.image(db.imageName)
95-
.networkDisabled(false)
96-
.env(db.env.map { case (k, v) => s"$k=$v" }.toSeq.asJava)
97-
.exposedPorts(s"${db.jdbcPort}/tcp")
98-
.build()
99-
containerId = docker.createContainer(config).id
10092
// Configure networking (necessary for boot2docker / Docker Machine)
10193
val externalPort: Int = {
10294
val sock = new ServerSocket(0)
@@ -110,8 +102,17 @@ abstract class DockerJDBCIntegrationSuite
110102
.portBindings(
111103
Map(s"${db.jdbcPort}/tcp" -> List(PortBinding.of(dockerIp, externalPort)).asJava).asJava)
112104
.build()
105+
// Create the database container:
106+
val config = ContainerConfig.builder()
107+
.image(db.imageName)
108+
.networkDisabled(false)
109+
.env(db.env.map { case (k, v) => s"$k=$v" }.toSeq.asJava)
110+
.hostConfig(hostConfig)
111+
.exposedPorts(s"${db.jdbcPort}/tcp")
112+
.build()
113+
containerId = docker.createContainer(config).id
113114
// Start the container and wait until the database can accept JDBC connections:
114-
docker.startContainer(containerId, hostConfig)
115+
docker.startContainer(containerId)
115116
jdbcUrl = db.getJdbcUrl(dockerIp, externalPort)
116117
eventually(timeout(60.seconds), interval(1.seconds)) {
117118
val conn = java.sql.DriverManager.getConnection(jdbcUrl)

0 commit comments

Comments
 (0)