Skip to content

Commit

Permalink
Merge pull request #235 from Jojo255/privilegedFix
Browse files Browse the repository at this point in the history
Added privileged support for Docker containers
  • Loading branch information
rnorth committed Nov 7, 2016
2 parents 0307150 + ee296af commit ba15667
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ public String getStderr() {
*/
SELF withStartupTimeout(Duration startupTimeout);

/**
* Set the privilegedMode mode for the container
* @param mode boolean
* @return this
*/
SELF withPrivilegedMode(boolean mode);

/**
* Get the IP address that this container may be reached on (may not be the local machine).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>
@NonNull
private List<Bind> binds = new ArrayList<>();

@NonNull
private boolean privilegedMode;

@NonNull
private Map<String, LinkableContainer> linkedContainers = new HashMap<>();

Expand Down Expand Up @@ -405,6 +408,10 @@ private void applyConfiguration(CreateContainerCmd createCommand) {
if (workingDirectory != null) {
createCommand.withWorkingDir(workingDirectory);
}

if (privilegedMode) {
createCommand.withPrivileged(privilegedMode);
}
}

/**
Expand Down Expand Up @@ -610,6 +617,12 @@ public SELF withStartupTimeout(Duration startupTimeout) {
return self();
}

@Override
public SELF withPrivilegedMode(boolean mode) {
this.privilegedMode = mode;
return self();
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit ba15667

Please sign in to comment.