package cn.reghao.bnt.common.docker;

import cn.reghao.bnt.common.docker.model.Config;
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.api.model.Image;
import com.github.dockerjava.api.model.Version;

import java.util.List;

/**
 * Docker 客户端
 *
 * @author reghao
 * @date 2021-10-27 04:17:38
 */
public interface Docker {
    void auth();
    Version version();
    void build(String repoTag, String compileHome, String dockerfileContent) throws Exception;
    void push(String image) throws Exception;
    void pull(String repoTag) throws Exception;
    void stopAndDelete(String containerName) throws Exception;
    InspectContainerResponse createAndRun(String containerName, Config containerConfig) throws Exception;
    void runAndRm(Config containerConfig) throws Exception;
    InspectContainerResponse start(String containerName);
    InspectContainerResponse stop(String containerName);
    InspectContainerResponse restart(String containerName);
    InspectContainerResponse inspectContainer(String containerName);
    List<Image> images();
    void imageRm(String imageId);
    void rm(String containerId);
    List<InspectContainerResponse> psAll();
    InspectContainerResponse ps(String containerName);
}
