Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added privileged support for Docker containers #235

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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