Skip to content

Commit 3f71f1f

Browse files
committed
Fixes Issue #584
Adds RootDir property to GraphData. This was seen on a CentOS system without aufs support.
1 parent a1d1e3d commit 3f71f1f

File tree

2 files changed

+157
-64
lines changed

2 files changed

+157
-64
lines changed

src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -34,51 +34,49 @@ public void serder1_22Json() throws IOException {
3434

3535
final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, "images/image1/inspect1.json", type);
3636

37-
final ContainerConfig config = new ContainerConfig().withAttachStderr(false)
38-
.withAttachStdin(false)
39-
.withAttachStdout(false)
40-
.withCmd(null)
41-
.withDomainName("")
42-
.withEntrypoint(null)
43-
.withEnv(new String[] { "HOME=/",
44-
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" })
45-
.withExposedPorts(null)
46-
.withHostName("aee9ba801acc")
47-
.withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158")
48-
.withLabels(null)
49-
.withMacAddress(null)
50-
.withNetworkDisabled(null)
51-
.withOnBuild(new String[] {})
52-
.withStdinOpen(false)
53-
.withPortSpecs(null)
54-
.withStdInOnce(false)
55-
.withTty(false)
56-
.withUser("")
57-
.withVolumes(null)
58-
.withWorkingDir("");
37+
final ContainerConfig config = new ContainerConfig().withAttachStdout(false)
38+
.withCmd(null)
39+
.withDomainName("")
40+
.withEntrypoint(null)
41+
.withEnv(new String[] {"HOME=/",
42+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"})
43+
.withExposedPorts(null)
44+
.withHostName("aee9ba801acc")
45+
.withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158")
46+
.withLabels(null)
47+
.withMacAddress(null)
48+
.withNetworkDisabled(null)
49+
.withOnBuild(new String[] {})
50+
.withStdinOpen(false)
51+
.withPortSpecs(null)
52+
.withStdInOnce(false)
53+
.withTty(false)
54+
.withUser("")
55+
.withVolumes(null)
56+
.withWorkingDir("");
5957

6058
final ContainerConfig containerConfig = new ContainerConfig().withAttachStderr(false)
61-
.withAttachStdin(false)
62-
.withAttachStdout(false)
63-
.withCmd(new String[] { "/bin/sh", "-c", "#(nop) MAINTAINER hack@worldticket.net" })
64-
.withDomainName("")
65-
.withEntrypoint(null)
66-
.withEnv(new String[] { "HOME=/",
67-
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" })
68-
.withExposedPorts(null)
69-
.withHostName("aee9ba801acc")
70-
.withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158")
71-
.withLabels(null)
72-
.withMacAddress(null)
73-
.withNetworkDisabled(null)
74-
.withOnBuild(new String[] {})
75-
.withStdinOpen(false)
76-
.withPortSpecs(null)
77-
.withStdInOnce(false)
78-
.withTty(false)
79-
.withUser("")
80-
.withVolumes(null)
81-
.withWorkingDir("");
59+
.withAttachStdin(false)
60+
.withAttachStdout(false)
61+
.withCmd(new String[] {"/bin/sh", "-c", "#(nop) MAINTAINER hack@worldticket.net"})
62+
.withDomainName("")
63+
.withEntrypoint(null)
64+
.withEnv(new String[] {"HOME=/",
65+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"})
66+
.withExposedPorts(null)
67+
.withHostName("aee9ba801acc")
68+
.withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158")
69+
.withLabels(null)
70+
.withMacAddress(null)
71+
.withNetworkDisabled(null)
72+
.withOnBuild(new String[] {})
73+
.withStdinOpen(false)
74+
.withPortSpecs(null)
75+
.withStdInOnce(false)
76+
.withTty(false)
77+
.withUser("")
78+
.withVolumes(null)
79+
.withWorkingDir("");
8280

8381
assertThat(inspectImage, notNullValue());
8482
assertThat(inspectImage.getArch(), is("amd64"));
@@ -113,21 +111,21 @@ public void serder1_22Json() throws IOException {
113111
assertThat(inspectImage.getVirtualSize(), is(0L));
114112

115113
final InspectImageResponse inspectImageResponse = new InspectImageResponse().withArch("amd64")
116-
.withAuthor("hack@worldticket.net")
117-
.withComment("")
118-
.withConfig(config)
119-
.withContainer("aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133")
120-
.withContainerConfig(containerConfig)
121-
.withCreated("2014-04-29T19:59:10.84997669Z")
122-
.withDockerVersion("0.8.1")
123-
.withId("sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24")
124-
.withOs("linux")
125-
.withParent("")
126-
.withSize(0L)
127-
.withRepoTags(Collections.singletonList("hackmann/empty:latest"))
128-
.withRepoDigests(Collections.<String> emptyList())
129-
.withVirtualSize(0L)
130-
.withGraphDriver(aufsGraphDriver);
114+
.withAuthor("hack@worldticket.net")
115+
.withComment("")
116+
.withConfig(config)
117+
.withContainer("aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133")
118+
.withContainerConfig(containerConfig)
119+
.withCreated("2014-04-29T19:59:10.84997669Z")
120+
.withDockerVersion("0.8.1")
121+
.withId("sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24")
122+
.withOs("linux")
123+
.withParent("")
124+
.withSize(0L)
125+
.withRepoTags(Collections.singletonList("hackmann/empty:latest"))
126+
.withRepoDigests(Collections.<String> emptyList())
127+
.withVirtualSize(0L)
128+
.withGraphDriver(aufsGraphDriver);
131129

132130
assertThat(inspectImage, equalTo(inspectImageResponse));
133131
}
@@ -143,7 +141,9 @@ public void serder1_22_doc() throws IOException {
143141

144142
assertThat(inspectImage.getRepoDigests(), hasSize(1));
145143
assertThat(inspectImage.getRepoDigests(),
146-
contains("localhost:5000/test/busybox/example@" + "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"));
144+
145+
contains("localhost:5000/test/busybox/example@"
146+
+ "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"));
147147

148148
assertThat(inspectImage.getRepoTags(), hasSize(3));
149149
assertThat(inspectImage.getRepoTags(), containsInAnyOrder("example:1.0", "example:latest", "example:stable"));
@@ -157,9 +157,8 @@ public void serder1_22_inspect_doc() throws IOException {
157157
final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, "images/docImage/inspect_doc.json", type);
158158

159159
GraphData newGraphData = new GraphData().withDeviceId("5")
160-
.withDeviceName("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47")
161-
.withDeviceSize("171798691840");
162-
160+
.withDeviceName("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47")
161+
.withDeviceSize("171798691840");
163162
assertThat(inspectImage, notNullValue());
164163
GraphDriver graphDriver = inspectImage.getGraphDriver();
165164
assertThat(graphDriver, notNullValue());
@@ -179,7 +178,8 @@ private void testOverlayNetworkRootDir() throws IOException {
179178

180179
final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, "images/overlay/inspectOverlay.json", type);
181180

182-
final GraphData overlayGraphData = new GraphData().withRootDir("/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root");
181+
final GraphData overlayGraphData = new GraphData()
182+
.withRootDir("/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root");
183183
final GraphDriver overlayGraphDriver = new GraphDriver().withName("overlay").withData(overlayGraphData);
184184
final GraphDriver graphDriver = inspectImage.getGraphDriver();
185185
assertThat(graphDriver, notNullValue());
@@ -188,4 +188,4 @@ private void testOverlayNetworkRootDir() throws IOException {
188188
assertThat(graphDriver.getData(), equalTo(overlayGraphData));
189189

190190
}
191-
}
191+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"Id": "sha256:0ac989a7cba2ce7f5fbe5d520b338e780055ec251371ee35f7462ae9944696c5",
3+
"RepoTags": [
4+
"test-image:latest"
5+
],
6+
"RepoDigests": [],
7+
"Parent": "",
8+
"Comment": "",
9+
"Created": "2016-05-24T19:25:01.31608131Z",
10+
"Container": "221f000eccdec85b74cd4f4f37c7c0392d0f620bee45e9618cac3e57409a6d2c",
11+
"ContainerConfig": {
12+
"Hostname": "6ea525e7ec5c",
13+
"Domainname": "",
14+
"User": "",
15+
"AttachStdin": false,
16+
"AttachStdout": false,
17+
"AttachStderr": false,
18+
"Tty": false,
19+
"OpenStdin": false,
20+
"StdinOnce": false,
21+
"Env": [
22+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
23+
],
24+
"Cmd": [
25+
"/bin/sh",
26+
"-c",
27+
"#(nop) ENTRYPOINT [\"bin/run.sh\"]"
28+
],
29+
"Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7",
30+
"Volumes": {
31+
"/var/lib/docker": {}
32+
},
33+
"WorkingDir": "/opt",
34+
"Entrypoint": [
35+
"bin/run.sh"
36+
],
37+
"OnBuild": [],
38+
"Labels": {}
39+
},
40+
"DockerVersion": "1.11.1",
41+
"Author": "",
42+
"Config": {
43+
"Hostname": "6ea525e7ec5c",
44+
"Domainname": "",
45+
"User": "",
46+
"AttachStdin": false,
47+
"AttachStdout": false,
48+
"AttachStderr": false,
49+
"Tty": false,
50+
"OpenStdin": false,
51+
"StdinOnce": false,
52+
"Env": [
53+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
54+
],
55+
"Cmd": null,
56+
"Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7",
57+
"Volumes": {
58+
"/var/lib/docker": {}
59+
},
60+
"WorkingDir": "/opt",
61+
"Entrypoint": [
62+
"bin/run.sh"
63+
],
64+
"OnBuild": [],
65+
"Labels": {}
66+
},
67+
"Architecture": "amd64",
68+
"Os": "linux",
69+
"Size": 345943268,
70+
"VirtualSize": 345943268,
71+
"GraphDriver": {
72+
"Name": "overlay",
73+
"Data": {
74+
"RootDir": "/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root"
75+
}
76+
},
77+
"RootFS": {
78+
"Type": "layers",
79+
"Layers": [
80+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
81+
"sha256:bd8153423e4131205018c431283e0a08298b291838db9bc6c19620523f5a818c",
82+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
83+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
84+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
85+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
86+
"sha256:bb0716c3f5f5be1e5ee6912f7e9f44193898e0b3ed9031a0416f8ca262e89975",
87+
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
88+
"sha256:58845ae9bfa7659900a9b30abb2c96330eff09bfbc6521ea77937ba60f8cc131",
89+
"sha256:8c22161a61c24eb6f7aa130d45189354fd8dbe9467e5b2debf828908113eacb0",
90+
"sha256:0c0c9045d2542e7845a2bdd8ead0e0fb2722be2c07c5553838dd61ffe051d672"
91+
]
92+
}
93+
}

0 commit comments

Comments
 (0)