Thanks to visit codestin.com
Credit goes to github.com

Skip to content

.withDockerTlsVerify(true) invalid #2198

Closed
@landashu

Description

@landashu

When I configure the properties of DockerClientConfig, I set withDockerTlsVerify to false, but it will eventually become an https request when requesting Docker private libraries,Here is my code:

DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
.withDockerHost("tcp://"+item.getServerIp()+":"+item.getListPort())
.withDockerTlsVerify(false)
.build();
DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
.dockerHost(config.getDockerHost())
.maxConnections(5)
.connectionTimeout(Duration.ofSeconds(5))
.responseTimeout(Duration.ofSeconds(5))
.build();
DockerClient dockerClient = DockerClientImpl.getInstance(config, httpClient);
DockerManagerVO dockerManagerVO = new DockerManagerVO();
dockerManagerVO.setDockerClient(dockerClient);
DockerManager.put(item.getId(),dockerManagerVO);

DockerConfigFindVO dockerConfigFindVO = dockerConfigMapper.findById(data.getConfigId());=
authConfig
.withRegistryAddress(dockerConfigFindVO.getConfigUrl())
.withUsername(dockerConfigFindVO.getConfigUserName())
.withPassword(dockerConfigFindVO.getConfigPassword());

    dockerManagerVO.getDockerClient()
            .tagImageCmd(data.getImageId(), data.getNewImageName(), data.getNewTagName())
            .exec();

    dockerManagerVO.getDockerClient()
            .pushImageCmd(data.getNewImageName()+":"+data.getNewTagName())
            .withAuthConfig(authConfig)
            .start();

ffbdbbced6e2b87cdaf34606c83b831

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions