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

Using [Experimental] Docker Shell Step with Windows container #231

Open
AndiAnS opened this issue May 11, 2018 · 2 comments
Open

Using [Experimental] Docker Shell Step with Windows container #231

AndiAnS opened this issue May 11, 2018 · 2 comments

Comments

@AndiAnS
Copy link

AndiAnS commented May 11, 2018

Hi,

I want to use the plugin with windows. For my first tests I am using the Docker Shell Step, but my job fails with the following message:

`Trying to create container for myimage
Created container c9efb95603b639436814c89c2bfa73c036dc61194650f3baa9b41add5376bb37, for #7
Starting container with:
CMD:'',
Entrypoint:
'/bin/sh','/tmp/executor.sh',
failed to start cmd
FATAL: com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"Could not find the file /tmp in container c9efb95603b639436814c89c2bfa73c036dc61194650f3baa9b41add5376bb37"}

com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"Could not find the file /tmp in container c9efb95603b639436814c89c2bfa73c036dc61194650f3baa9b41add5376bb37"}

at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:47)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$Builder.put(JerseyInvocation.java:326)
at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:33)
at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:15)
at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl.exec(CopyArchiveToContainerCmdImpl.java:153)
at com.github.kostyasha.yad.steps.DockerShellStep.perform(DockerShellStep.java:210)

Caused: java.io.IOException
at com.github.kostyasha.yad.steps.DockerShellStep.perform(DockerShellStep.java:260)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1727)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)`

The problem is, that the entrypoint is wrong. It is a linux path which is not available in my windows container.

How can I overwrite the entrypoint in order to start a windows container?

Thank you very much!

Best regards
Andi

@dkumar95120
Copy link

Try using the "Windows Batch Command" instead of "Docker Shell Step" in the Jenkins job.

@AndiAnS
Copy link
Author

AndiAnS commented Jun 1, 2018

when I set up a cloud, I can use it with windows. But this special function seems not to work with windows. I read the code and I think the platform checks for this feature are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants