Skip to content

Commit

Permalink
feat: update dockerfile to avoid hardcoded version for jar files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesho committed Nov 20, 2024
1 parent af04107 commit bf1b194
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions coordinator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ RUN unzip /src/coordinator.zip -d /libs
WORKDIR /libs/coordinator/lib/

RUN mkdir -p unpacked-blob-compressor unpacked-blob-shnarf-calculator
RUN cd unpacked-blob-compressor/ && jar -xf ../blob-compressor-0.0.4.jar
RUN cd unpacked-blob-shnarf-calculator/ && jar -xf ../blob-shnarf-calculator-0.0.4.jar

RUN rm -rf unpacked-blob-compressor/darwin-** && \
rm -rf unpacked-blob-shnarf-calculator/darwin-** && \
RUN bcJar=$(set -- blob-compressor-[0-9].[0-9].[0-9].jar; echo $1) && \
bscJar=$(set -- blob-shnarf-calculator-[0-9].[0-9].[0-9].jar; echo $1) && \
cd unpacked-blob-compressor/ && jar -xf ../$bcJar && cd .. && \
cd unpacked-blob-shnarf-calculator/ && jar -xf ../$bscJar && cd .. && \
rm -rf unpacked-blob-compressor/darwin-** unpacked-blob-shnarf-calculator/darwin-** && \
case $(uname -m) in \
x86_64) \
rm -rf unpacked-blob-compressor/linux-aarch64/; \
Expand All @@ -26,11 +26,10 @@ RUN rm -rf unpacked-blob-compressor/darwin-** && \
rm -rf unpacked-blob-compressor/linux-x86-64/; \
rm -rf unpacked-blob-shnarf-calculator/linux-x86-64/; \
;; \
esac

RUN jar -cf blob-compressor-0.0.4.jar -C unpacked-blob-compressor . && \
jar -cf blob-shnarf-calculator-0.0.4.jar -C unpacked-blob-shnarf-calculator . && \
rm -rf unpacked-blob-compressor && rm -rf unpacked-blob-shnarf-calculator
esac && \
jar -cf $bcJar -C unpacked-blob-compressor . && \
jar -cf $bscJar -C unpacked-blob-shnarf-calculator .
RUN rm -rf unpacked-blob-compressor unpacked-blob-shnarf-calculator

# FINAL image
FROM eclipse-temurin:21-jre-noble
Expand Down

0 comments on commit bf1b194

Please sign in to comment.