Skip to content

Commit b627d39

Browse files
authored
Merge pull request jenkinsci#87 from stevekuznetsov/skuznets/mount-shared
Label the Docker workspace volume mount shared
2 parents f32bca9 + 273cb15 commit b627d39

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,15 @@ public static class Execution extends AbstractStepExecutionImpl {
132132
toolName = step.toolName;
133133
DockerClient dockerClient = new DockerClient(launcher, node, toolName);
134134

135-
// Add a warning if the docker version is less than 1.4
136135
VersionNumber dockerVersion = dockerClient.version();
137136
if (dockerVersion != null) {
138-
if (dockerVersion.isOlderThan(new VersionNumber("1.4"))) {
139-
throw new AbortException("The docker version is less than v1.4. Pipeline functions requiring 'docker exec' will not work e.g. 'docker.inside'.");
137+
if (dockerVersion.isOlderThan(new VersionNumber("1.7"))) {
138+
throw new AbortException("The docker version is less than v1.7. Pipeline functions requiring 'docker exec' (e.g. 'docker.inside') or SELinux labeling will not work.");
140139
} else if (dockerVersion.isOlderThan(new VersionNumber("1.8"))) {
141140
listener.error("The docker version is less than v1.8. Running a 'docker.inside' from inside a container will not work.");
142141
}
143142
} else {
144-
listener.error("Failed to parse docker version. Please note there is a minimum docker version requirement of v1.4.");
143+
listener.error("Failed to parse docker version. Please note there is a minimum docker version requirement of v1.7.");
145144
}
146145

147146
FilePath tempDir = tempDir(workspace);

src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public String run(@Nonnull EnvVars launchEnv, @Nonnull String image, @CheckForNu
110110
argb.add("-w", workdir);
111111
}
112112
for (Map.Entry<String, String> volume : volumes.entrySet()) {
113-
argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw");
113+
argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw,z");
114114
}
115115
for (String containerId : volumesFromContainers) {
116116
argb.add("--volumes-from", containerId);

0 commit comments

Comments
 (0)