slim icon indicating copy to clipboard operation
slim copied to clipboard

Minified image curl error

Open thi747 opened this issue 4 years ago • 4 comments

Expected Behavior

As I run my image, it uses curl to fetch env file from git. After download is complete, it runs java/jboss and serves 8080.


Actual Behavior

When it tries to use curl I get: curl: (77) error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none

After download fails, JBoss fails to start because it can't find the env file, specified on the command. (FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1)


Steps to Reproduce the Problem

  1. docker run -it -p 8080:8080 -e ENV=prod image OK

  2. docker-slim build --target image--http-probe=false

  3. docker run -it -p 8080:8080 -e ENV=prod image.slim ERROR


Specifications

  • Version: Docker 20.10.10, Docker-slim 1.37.0
  • Platform: Debian 11

thi747 avatar Oct 27 '21 17:10 thi747

I have tried again with base image (without the need to download the env file and turns out the jboss also won't come up as expected. When booting it fails due to missing files:

Exception in thread "main" org.jboss.modules.ModuleLoadException: Error loading module from /opt/appsrv/EAP-7.1.5/modules/system/layers/base/sun/jdk/main/module.xml at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:298) at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:254) at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:215) at org.jboss.modules.LocalModuleFinder.parseModuleXmlFile(LocalModuleFinder.java:256) at org.jboss.modules.LocalModuleFinder.lambda$findModule$1(LocalModuleFinder.java:199) at org.jboss.modules.LocalModuleFinder$$Lambda$2/00000000A02A4530.run(Unknown Source) at java.security.AccessController.doPrivileged(AccessController.java:770) at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:199) at org.jboss.modules.ModuleLoader.findModule0(ModuleLoader.java:684) at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:677) at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:487) at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:390) at org.jboss.modules.Module.addExportedPaths(Module.java:1355) at org.jboss.modules.Module.addPaths(Module.java:1247) at org.jboss.modules.Module.link(Module.java:1574) at org.jboss.modules.Module.relinkIfNecessary(Module.java:1602) at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:287) at org.jboss.modules.Main.main(Main.java:399) Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'service-loader-resources' at path 'service-loader-resources' (position: END_TAG seen ... here -->\n ... @28:57) caused by: java.io.FileNotFoundException: /opt/appsrv/EAP-7.1.5/modules/system/layers/base/sun/jdk/main/service-loader-resources (No such file or directory) at org.jboss.modules.xml.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:1006) at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:850) at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:645) at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:416) at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:296) ... 17 more Caused by: java.io.FileNotFoundException: /opt/appsrv/EAP-7.1.5/modules/system/layers/base/sun/jdk/main/service-loader-resources (No such file or directory) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:225) at java.util.zip.ZipFile.(ZipFile.java:155) at java.util.jar.JarFile.(JarFile.java:166) at java.util.jar.JarFile.(JarFile.java:145) at org.jboss.modules.xml.JDKSpecific.getJarFile(JDKSpecific.java:33) at org.jboss.modules.xml.ModuleXmlParser$DefaultResourceRootFactory.createResourceLoader(ModuleXmlParser.java:1380) at org.jboss.modules.LocalModuleFinder.lambda$new$0(LocalModuleFinder.java:94) at org.jboss.modules.LocalModuleFinder$$Lambda$1/00000000A03B5670.createResourceLoader(Unknown Source) at org.jboss.modules.xml.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:1004) ... 21 more

thi747 avatar Nov 04 '21 18:11 thi747

Thanks a lot for the additional info @thi747 ! Curious why you do docker-slim build --target image--http-probe=false instead of docker-slim build --publish-port 8080:8080 --env ENV=prod --target image, which would be closer to what you have with the docker run command.

kcq avatar Nov 04 '21 23:11 kcq

Thanks a lot for the additional info @thi747 ! Curious why you do docker-slim build --target image--http-probe=false instead of docker-slim build --publish-port 8080:8080 --env ENV=prod --target image, which would be closer to what you have with the docker run command.

That was because I didn't find easy info on how to do stuff... I followed you advice and needed to add --expose 8080 to that to avoid building error (was I right?) but after running this new slim image I got the same jboss error as before.

thi747 avatar Nov 09 '21 18:11 thi747

testing other options I got to a point using also --preserve-path --include-path='/opt/appsrv', trying to save java and jboss. this way jboss goes up and netstat shows 8080 listening but even a local test gets connection refused....

thi747 avatar Nov 09 '21 19:11 thi747