anchor.diff:  ----
   +
   
  -* DockerfileResource for Dockerfiles: 
  +* *DockerfileResource for Dockerfiles*: 
   The Docker Addon has to provide APIs and services for interacting with real and virtual Dockerfile Resources, typically for the purpose of reading and manipulating Dockerfiles. 
   The addon uses https://github.com/shrinkwrap/descriptors-docker[Shrinkwrap Descriptors Docker], that provide reading,parsing,manipulating
   and writing Dockerfile commands to real and virtual Dockerfile resources provided by the addon.
  
positive.code: DockerDescriptor resourceDescriptor = resource.getDockerDescriptor();
  ----
  +
  * Facets implementation:
  Docker addon adds a `DockerFacet` which is entry point for Docker addon API.
  
  * Dockerfile Create Command:
  This command prepares the project for functioning in Docker context.
  +
  [source,shell]
  
negative.code: dockerfile-create
  ----
  +
  It installs the `DockerFacet` in your new project.
  
  * *Dockerfile Setup Command*:
  This command builds and packages your project and then generates the corresponding Dockerfile for deployment to docker containers.
  +
  [source,shell]
  ----
  dockerfile-setup
  ----
  +
  Sample Dockerfile Format created by this command:
  +
  [source,text]
  ----
  FROM jboss/wildfly
  ADD target/your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
  ----
  +
  
  The Dockerfile generated deploys your app to a JBoss Wildfly Container.
  
  * *Docker API to handle docker related tasks*: The API allows for programatically manipulating Docker related tasks. Works as a wrapper over the https://github.com/docker-java/docker-java[docker-java] library.
  +
  [source,java]
  ----
  @Inject
  private DockerUtils dockerUtils;
  ----
  +
  You may obtain the DockerClient correponding to your Docker installation by simply calling the `getDockerClient` method of DockerUtils:
  +
  [source,java]
  ----
  DockerClient dockerClient=dockerUtils.getDockerClient("http://localhost:2375")
  ----
  +
  Where the parameter passed is the Docker URL, e.g. https://localhost:2375 or unix:///var/run/docker.sock.
  Overloaded versions of the `getDockerClient` method are provided to configure various Docker related settings such as API version,your registry username (required to push containers) etc.
  +
  *Working with Images*
  +
  [source,java]
  ----
  @Inject
  private DockerImageUtils dockerImageUtils;
  ----
  +
  Working with images simply requires calling functions of `DockerImageUtils`.
  +
  [source,java]
  ----
  //Pull Images
  PullResponseItem pullImage = dockerImageUtils.pullImage(dockerClient, "busybox");
  
  //Search Images
  List<SearchItem> imageSearch = dockerImageUtils.searchImages(dockerClient, "busybox");
  
  //Remove Images
  dockerImageUtils.removeImage(dockerClient, "af340544ed62");
  
  //List of Images
  List<Image> listImages = dockerImageUtils.listImages(dockerClient);
  
  //Inspect Image
  InspectImageResponse inspectImageResponse=dockerImageUtils.inspectImage(dockerClient, "af340544ed62");
  ----
  +
  *Working with Containers*
  +
  [source,java]
  ----
  @Inject
  private DockerContainerUtils dockerContainerUtils;
  ----
  +
  Working with containers simply requires calling functions of `DockerContainerUtils`.
  +
  [source,java]
  ----
  //List of Containers
  List<Container> containers = dockerContainerUtils.listContainers(dockerClient);
  
  //Start a Container
  dockerContainerUtils.startContainer(dockerClient, "787bdb423b3c");
  
  //Run a command in a running container
  String[] cmd = { "touch", "file.log" };
  ExecCreateCmdResponse execCreateCmdResponse =dockerContainerUtils.execCreate(dockerClient, "787bdb423b3c", cmd, false, false, false, false);
  
  //Remove a Container
  dockerContainerUtils.removeContainer(dockerClient,"787bdb423b3c");
  
  //Wait a Container
  int exitCode = dockerContainerUtils.waitContainer(dockerClient, "787bdb423b3c");
  
  //Copy files or folders from a container
  InputStream response =dockerContainerUtils.copyFileFromContainer(dockerClient,"787bdb423b3c","/copyFromContainer");
  
  //Inspect changes on a container's filesystem
  List<ChangeLog> filesystemDiff = dockerContainerUtils.containerDiff(dockerClient,"787bdb423b3c");
  
  //Stop a Container
  dockerContainerUtils.stopContainer(dockerClient,"787bdb423b3c", 2);
  
  //Kill a Container
  dockerContainerUtils.killContainer(dockerClient, "787bdb423b3c");
  
  //Restart a Container
   dockerContainerUtils.restartContainer(dockerClient, "787bdb423b3c", 2);
   
  //Build a image
  File dockerFile= ...;
  BuildResponseItem buildImage = dockerContainerUtils.buildImage(dockerClient,dockerFile);
  ----
  +
  Additional overloaded variants of the above methods have been provided to provide support for additional parameters required in Docker related operations.
  +
  * *Docker Command support over the Forge CLI*: DockerCommand supports running Docker CLI commands on the Forge CLI. 
  +  
  Eg: "docker images" command shows your Docker images on the Forge CLI just as it works on a usual CLI.
  +
  You can run your regular Docker commands like "docker ps" now on the Forge CLI.