Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npipe support for build-info-extractor-docker #797

Open
Ru13en opened this issue Jul 15, 2024 · 3 comments · May be fixed by #798
Open

Add npipe support for build-info-extractor-docker #797

Ru13en opened this issue Jul 15, 2024 · 3 comments · May be fixed by #798
Labels
bug Create a report to help us improve

Comments

@Ru13en
Copy link

Ru13en commented Jul 15, 2024

Describe the bug
On windows using windows containers is not possible to use the npipe protocol to publish docker images to the artifactory.
The NettyDockerCmdExecFactory does not support the npipe protocol which has been used here:
https://github.com/jfrog/build-info/blob/master/build-info-extractor-docker/src/main/java/org/jfrog/build/extractor/docker/DockerJavaWrapper.java#L77
I found this comment in the docker-java repository:
docker-java/docker-java#765 (comment)
So I suggest the replacement from NettyDockerCmdExecFactory to OkHttpDockerCmdExecFactory in order to support npipe.

To Reproduce
Configure windows docker engine to use windows containers.
Configure a Jenkins instance with docker clouds.
Add the following mount to the docker cloud template (exposes the host docker engine to the ephemeral container):
type=npipe,source=\.\pipe\docker_engine,destination=\.\pipe\docker_engine

Add and execute a pipeline that makes use of the Artifactory.docker (see example in the first screenshot).

Expected behavior
At red is the affected code leading to the exception shown in the second screenshot.
If we just use the docker-plugin from jenkins there is no issues.

Screenshots
image
image

Versions

  • Extractor version: v2.41.21
  • Operating system: Windows 10
  • Artifactory Version: 7.84.17

Additional context
Add any other context about the problem here.

@Ru13en Ru13en added the bug Create a report to help us improve label Jul 15, 2024
@displaylink-kstrzemp
Copy link

Hello!
I've just encountered this issue today when trying to push docker image to artifactory from windows machine. My jenkinsfile snippet:

   // Capture build environment
    rtBuildInfo (
        captureEnv: true,
        buildName: "${BUILD_INFO_NAME}"
    )

    // Deploy the 'latest' image
    rtDockerPush(
        serverId: 'Artifactory',
        image: "${IMAGE_PATH}:${BARE_IMAGE_TAG}",
        targetRepo: DOCKER_REPO,
        buildName: "${BUILD_INFO_NAME}"
    )

Is this going to be fixed? Would jfrog-cli work better?

@Ru13en Ru13en linked a pull request Jul 17, 2024 that will close this issue
1 task
@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 18, 2024

@Ru13en,
For integrating Jenkins with the JFrog Platform, our recommendation is to avoid using the old Artifactory Jenkins Plugin, and use the newer JFrog Jenkins Plugin whenever it is possible. The older plugin, because of its design, introduces multiple issues, especially when it comes to the integration with docker. We will therefore refrain from making new investments in the Artifactory Jenkins Plugin.

@displaylink-kstrzemp
Copy link

Yes - I can confirm that jfrog-cli way works OK in my case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Create a report to help us improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants