title: Alternative to openjdk:8-alpine for Kafka Streams
body: <p>I am using openjdk:8-alpine for deploying Kafka Streams application. I am using Windowing and it crashes with below error:</p>
  
  <pre><code>Exception in thread "app-4a382bdc55ae-StreamThread-1" java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni94709417646402513.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/librocksdbjni94709417646402513.so)
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
      at java.lang.Runtime.load0(Runtime.java:809)
      at java.lang.System.load(System.java:1086)
      at org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:78)
      at org.rocksdb.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:56)
      at org.rocksdb.RocksDB.loadLibrary(RocksDB.java:64)
      at org.rocksdb.RocksDB.&lt;clinit&gt;(RocksDB.java:35)
      at org.rocksdb.Options.&lt;clinit&gt;(Options.java:22)
      at org.apache.kafka.streams.state.internals.RocksDBStore.openDB(RocksDBStore.java:116)
      at org.apache.kafka.streams.state.internals.Segment.openDB(Segment.java:43)
      at org.apache.kafka.streams.state.internals.Segments.getOrCreateSegment(Segments.java:91)
      at org.apache.kafka.streams.state.internals.RocksDBSegmentedBytesStore.put(RocksDBSegmentedBytesStore.java:100)
      at org.apache.kafka.streams.state.internals.RocksDBSessionStore.put(RocksDBSessionStore.java:122)
      at org.apache.kafka.streams.state.internals.ChangeLoggingSessionBytesStore.put(ChangeLoggingSessionBytesStore.java:78)
      at org.apache.kafka.streams.state.internals.ChangeLoggingSessionBytesStore.put(ChangeLoggingSessionBytesStore.java:33)
      at org.apache.kafka.streams.state.internals.CachingSessionStore.putAndMaybeForward(CachingSessionStore.java:177)
      at org.apache.kafka.streams.state.internals.CachingSessionStore.access$000(CachingSessionStore.java:38)
      at org.apache.kafka.streams.state.internals.CachingSessionStore$1.apply(CachingSessionStore.java:88)
      at org.apache.kafka.streams.state.internals.NamedCache.flush(NamedCache.java:142)
      at org.apache.kafka.streams.state.internals.NamedCache.flush(NamedCache.java:100)
      at org.apache.kafka.streams.state.internals.ThreadCache.flush(ThreadCache.java:127)
      at org.apache.kafka.streams.state.internals.CachingSessionStore.flush(CachingSessionStore.java:193)
      at org.apache.kafka.streams.state.internals.MeteredSessionStore.flush(MeteredSessionStore.java:169)
      at org.apache.kafka.streams.processor.internals.ProcessorStateManager.flush(ProcessorStateManager.java:244)
      at org.apache.kafka.streams.processor.internals.AbstractTask.flushState(AbstractTask.java:195)
      at org.apache.kafka.streams.processor.internals.StreamTask.flushState(StreamTask.java:332)
      at org.apache.kafka.streams.processor.internals.StreamTask$1.run(StreamTask.java:312)
      at org.apache.kafka.streams.processor.internals.StreamsMetricsImpl.measureLatencyNs(StreamsMetricsImpl.java:208)
      at org.apache.kafka.streams.processor.internals.StreamTask.commit(StreamTask.java:307)
      at org.apache.kafka.streams.processor.internals.StreamTask.commit(StreamTask.java:297)
      at org.apache.kafka.streams.processor.internals.AssignedTasks$1.apply(AssignedTasks.java:67)
      at org.apache.kafka.streams.processor.internals.AssignedTasks.applyToRunningTasks(AssignedTasks.java:357)
      at org.apache.kafka.streams.processor.internals.AssignedTasks.commit(AssignedTasks.java:347)
      at org.apache.kafka.streams.processor.internals.TaskManager.commitAll(TaskManager.java:403)
      at org.apache.kafka.streams.processor.internals.StreamThread.maybeCommit(StreamThread.java:994)
      at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:811)
      at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:750)
      at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:720)
  </code></pre>
  
  <p>Searching for the above issue, i came across <a href="https://issues.apache.org/jira/browse/KAFKA-4988" rel="noreferrer">https://issues.apache.org/jira/browse/KAFKA-4988</a>. But it didn't helped.</p>
  
  <p>So, Alpine uses musl-libc but it's not supported by RocksDB. 
  The issue to add support for musl-libc to RocksDB: <a href="https://github.com/facebook/rocksdb/pull/3143" rel="noreferrer">facebook/rocksdb#3143</a>.</p>
  
  <p>Question:Is there any openjdk docker image using which i can make my Kafka Stream application run and which won't give rocksdb issue?</p>
  
  <p>Edit-1: I tried <code>RUN apk add --no-cache bash libc6-compat</code>, but it too fails with below error:</p>
  
  <pre><code># A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0x000000000011e336, pid=1, tid=0x00007fc6a3cc8ae8
  #
  # JRE version: OpenJDK Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13)
  # Java VM: OpenJDK 64-Bit Server VM (25.181-b13 mixed mode linux-amd64 compressed oops)
  # Derivative: IcedTea 3.9.0
  # Distribution: Custom build (Tue Oct 23 11:27:22 UTC 2018)
  # Problematic frame:
  # C  0x000000000011e336
  #
  # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
  </code></pre>