1

I need to run a local language server as a docker container by including it in a dockerfile. I built a simple language server following only the section under "Provide the Xtext Language Server". This is the Dockerfile I wrote to build the image:

FROM eclipse/che
ADD xtextls3 C:\Users\abc\xtext_ls3
RUN sudo apt-get install socat -y
CMD socat TCP4-LISTEN:4417,reuseaddr,form EXEC:"xtextls"

I don't know whether this is correct. "xtextls3" is the eclipse workspace folder I used to create my language server. When I try to build this dockerfile, I get this error: ADD failed: stat /var/lib/docker/tmp/docker-builder342449789/xtextls3

What is the correct method to include my language server in a dockerfile, and build a docker image from it?

SharkJ
  • 49
  • 1
  • 12

2 Answers2

0

I might think that the problem lies in the ADD line. This adds the local file xtextls3 to your layer. However, the file cannot be found. I have the idea that you have to swap the first and second argument on the ADD-instruction.

Mikki
  • 180
  • 2
  • That did not work. I suppose it requires a different path. In a Linux OS, I should be using the home directory, I, guess. What is the home folder in a windows OS? – SharkJ Oct 03 '18 at 02:47
  • The error fairly clearly shows you that `xtextls3` cannot be found, which is on the first argument on your ADD-instruction. I think the problem lies more in this part rather than the image-end. – Mikki Oct 04 '18 at 08:36
  • You're right. I finally resolved the error, and I have mentioned my answer below. Thank You for the help! – SharkJ Oct 04 '18 at 08:51
0

It seems that I should be stating the path in relation to the context directory (current location I'm at in the command prompt). I placed my .jar file in the same folder where the Dockerfile is and changed the Dockerfile content as follows:

FROM barais/eclipse-xtend
ADD build/libs/dsl-language-server-ls.jar dsl-language-server-ls.jar
RUN sudo apt-get install socat
CMD socat TCP4-LISTEN:4417,reuseaddr,fork EXEC:"mydsl"

"build/libs/dsl-language-server-ls.jar" is the path+file, and "dsl-language-server-ls.jar" is the binary file that I require.

SharkJ
  • 49
  • 1
  • 12