LOGGER.debug("Executing Docker Commit Container Request");
String containerId = DockerHelper.getProperty(DockerConstants.DOCKER_CONTAINER_ID, configuration, message, String.class);
CommitCmd commitCmd = client.commitCmd(containerId);
String repository = DockerHelper.getProperty(DockerConstants.DOCKER_REPOSITORY, configuration, message, String.class);
if (repository != null) {
commitCmd.withRepository(repository);
}
String msg = DockerHelper.getProperty(DockerConstants.DOCKER_MESSAGE, configuration, message, String.class);
if (message != null) {
commitCmd.withMessage(msg);
}
String tag = DockerHelper.getProperty(DockerConstants.DOCKER_TAG, configuration, message, String.class);
if (tag != null) {
commitCmd.withTag(tag);
}
String author = DockerHelper.getProperty(DockerConstants.DOCKER_TAG, configuration, message, String.class);
if (author != null) {
commitCmd.withAuthor(tag);
}
Boolean attachStdIn = DockerHelper.getProperty(DockerConstants.DOCKER_ATTACH_STD_IN, configuration, message, Boolean.class);
if (attachStdIn != null && attachStdIn) {
commitCmd.withAttachStdin();
}
Boolean attachStdOut = DockerHelper.getProperty(DockerConstants.DOCKER_ATTACH_STD_OUT, configuration, message, Boolean.class);
if (attachStdOut != null && attachStdOut) {
commitCmd.withAttachStdout();
}
Boolean attachStdErr = DockerHelper.getProperty(DockerConstants.DOCKER_ATTACH_STD_ERR, configuration, message, Boolean.class);
if (attachStdErr != null && attachStdErr) {
commitCmd.withAttachStderr();
}
String[] cmds = DockerHelper.parseDelimitedStringHeader(DockerConstants.DOCKER_CMD, message);
if (cmds != null) {
commitCmd.withCmd(cmds);
}
Boolean disableNetwork = DockerHelper.getProperty(DockerConstants.DOCKER_DISABLE_NETWORK, configuration, message, Boolean.class);
if (disableNetwork != null && disableNetwork) {
commitCmd.withDisableNetwork(disableNetwork);
}
Boolean pause = DockerHelper.getProperty(DockerConstants.DOCKER_PAUSE, configuration, message, Boolean.class);
if (pause != null && pause) {
commitCmd.withPause(pause);
}
String[] envs = DockerHelper.parseDelimitedStringHeader(DockerConstants.DOCKER_ENV, message);
if (envs != null) {
commitCmd.withEnv(envs);
}
ExposedPorts exposedPorts = DockerHelper.getProperty(DockerConstants.DOCKER_EXPOSED_PORTS, configuration, message, ExposedPorts.class);
if (exposedPorts != null) {
commitCmd.withExposedPorts(exposedPorts);
}
String hostname = DockerHelper.getProperty(DockerConstants.DOCKER_HOSTNAME, configuration, message, String.class);
if (hostname != null) {
commitCmd.withHostname(hostname);
}
Integer memory = DockerHelper.getProperty(DockerConstants.DOCKER_MEMORY, configuration, message, Integer.class);
if (memory != null) {
commitCmd.withMemory(memory);
}
Integer memorySwap = DockerHelper.getProperty(DockerConstants.DOCKER_MEMORY_SWAP, configuration, message, Integer.class);
if (memorySwap != null) {
commitCmd.withMemorySwap(memorySwap);
}
Boolean openStdIn = DockerHelper.getProperty(DockerConstants.DOCKER_OPEN_STD_IN, configuration, message, Boolean.class);
if (openStdIn != null && openStdIn) {
commitCmd.withOpenStdin(openStdIn);
}
String[] portSpecs = DockerHelper.parseDelimitedStringHeader(DockerConstants.DOCKER_PORT_SPECS, message);
if (portSpecs != null) {
commitCmd.withPortSpecs(portSpecs);
}
Boolean stdInOnce = DockerHelper.getProperty(DockerConstants.DOCKER_STD_IN_ONCE, configuration, message, Boolean.class);
if (stdInOnce != null && stdInOnce) {
commitCmd.withStdinOnce(stdInOnce);
}
Boolean tty = DockerHelper.getProperty(DockerConstants.DOCKER_TTY, configuration, message, Boolean.class);
if (tty != null && tty) {
commitCmd.withTty(tty);
}
String user = DockerHelper.getProperty(DockerConstants.DOCKER_USER, configuration, message, String.class);
if (user != null) {
commitCmd.withUser(user);
}
Volumes volumes = DockerHelper.getProperty(DockerConstants.DOCKER_VOLUMES, configuration, message, Volumes.class);
if (volumes != null) {
commitCmd.withVolumes(volumes);
}
String workingDir = DockerHelper.getProperty(DockerConstants.DOCKER_HOSTNAME, configuration, message, String.class);
if (workingDir != null) {
commitCmd.withWorkingDir(workingDir);
}
return commitCmd;