che icon indicating copy to clipboard operation
che copied to clipboard

Eclipse Che dockerfile build issue

Open AmitChameides opened this issue 7 years ago • 3 comments

Summary

Hey all, I'm trying to build a custom Che-Server image using the Dockerfile in che/dockerfile/che/.

I've cloned the project to my local computer and modified the dockerfile by adding some lines. However, when I try to build the dockerfile into an image using the command docker build -t eclipse/che-server . , I get hit by an error by the second-last line:

Step 9/10 : ADD eclipse-che /home/user/eclipse-che ADD failed: stat /var/lib/docker/tmp/docker-builder043939991/eclipse-che: no such file or directory

I understand what the error is saying - there's no directory called "eclipse-che" to copy from. However, this is just how the che project is - even without my modification, there is no directory called eclipse-che.

Am I missing something? What do I need to change in order to complete my image?

Relevant information

  • Running on Windows OS
  • Have proxy but it is configured in Docker settings
  • Building the dockerfile in the specified directory, so it has all the other files it relies on around it.

AmitChameides avatar Aug 22 '19 13:08 AmitChameides

try /build.sh --dockerfile:Dockerfile

skabashnyuk avatar Aug 22 '19 13:08 skabashnyuk

Hey @skabashnyuk I tried running the command as you described in the che/dockerfile/che/ directory and I got the following error: Have you built assembly/assemby-main in /c/Users/amichame/Desktop/che/dockerfiles/che/../assembly/assembly-main 'mvn clean install'?

From context + online documentation I figured that I need to mvn clean install for that command to work properly. So I went to the root directory of the project /che and ran the command mvn clean install. After 10~ minutes of running it failed on the following error when testing TypeScript DTO maven plugin:

[INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running org.eclipse.che.plugin.typescript.dto.TypeScriptDTOGeneratorMojoITest SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file C:\Users\amichame\Desktop\che\core\che-core-typescript-dto-maven-plugin\target\surefire-reports\2019-08-25T11-06-42_701-jvmRun1.dumpstream [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 5.612 s <<< FAILURE! - in org.eclipse.che.plugin.typescript.dto.TypeScriptDTOGeneratorMojoITest [ERROR] installTypeScriptCompiler(org.eclipse.che.plugin.typescript.dto.TypeScriptDTOGeneratorMojoITest) Time elapsed: 4.592 s <<< FAILURE! java.lang.IllegalStateException: Install of TypeScript has failed at org.eclipse.che.plugin.typescript.dto.TypeScriptDTOGeneratorMojoITest.installTypeScriptCompiler(TypeScriptDTOGeneratorMojoITest.java:226)

was I supposed to run mvn clean install at all, or am I missing something? Do you have any idea how to solve the current issue of mvn clean install?

AmitChameides avatar Aug 25 '19 08:08 AmitChameides

UPDATE: I managed to find the solution. The reason I couldn't successfully run the command mvn clean install was due to a couple of factors. At the end of the day, here's what I needed to do in order to successfully build my image:

  1. Make sure I'm not connected to a proxy.
  2. Make sure my local installation of Docker has its proxy settings turned off.
  3. In my terminal, go to the root directory of the project (/che) and run mvn clean install -P fast. This will make a faster, less secure version of the build ensue. This will still take a lot of time, though. It took me 47 minutes to finish the full process.
  4. If your Maven fails at some point, just run the command again, and perhaps it'll get over the issue. I know that sounds like voodoo but that's what worked for me in the end.
  5. When the Maven build is done, change your directory to che/dockerfiles/che and run the command @skabashnyuk wrote (./build.sh --dockerfile:Dockerfile).
  6. It should successfully build you your Che image from your Dockerfile.

AmitChameides avatar Aug 25 '19 13:08 AmitChameides