Class SaveImageCommand


  • public class SaveImageCommand
    extends DockerCommand
    This command saves specified Docker image(s).
    • Constructor Detail

      • SaveImageCommand

        public SaveImageCommand​(String imageName,
                                String imageTag,
                                String destination,
                                String filename,
                                boolean ignoreIfNotFound)
    • Method Detail

      • getImageName

        public String getImageName()
      • getImageTag

        public String getImageTag()
      • getDestination

        public String getDestination()
      • getFilename

        public String getFilename()
      • getIgnoreIfNotFound

        public boolean getIgnoreIfNotFound()
      • execute

        public void execute()
                     throws com.github.dockerjava.api.exception.DockerException
        Specified by:
        execute in class DockerCommand
        Throws:
        com.github.dockerjava.api.exception.DockerException
      • getDockerImageStream

        public InputStream getDockerImageStream()
                                         throws com.github.dockerjava.api.exception.DockerException
        Reads the docker image to memory
        Returns:
        input stream connected to the in-memory copy
        Throws:
        com.github.dockerjava.api.exception.DockerException - In case of failure
      • getDockerImageStream

        public void getDockerImageStream​(javax.servlet.http.HttpServletResponse response)
                                  throws com.github.dockerjava.api.exception.DockerException
        Parameters:
        response - HttpServletResponse
        Throws:
        com.github.dockerjava.api.exception.DockerException - In case of failure
      • getDockerImageStream

        public void getDockerImageStream​(javax.servlet.http.HttpServletResponse response,
                                         int bufferSizeKb)
                                  throws com.github.dockerjava.api.exception.DockerException
        Pulls the docker image and streams the content via the docker Save command to the response object's output stream.
        Parameters:
        response - HttpServletResponse
        bufferSizeKb - Buffer size in kilobytes; e.g., value 8 results in buffer size of 8 * 1024.
        Throws:
        com.github.dockerjava.api.exception.DockerException - In case of failure