rnewson commented on PR #48:
URL: https://github.com/apache/couchdb-ci/pull/48#issuecomment-1484132979

   @nickva I guess I got bored, but for example;
   
   ```
   ARG BASE
   FROM ${BASE}
   ARG ERLANG_VERSION=25
   ARG ELIXIR_VERSION=1.13
   ARG JAVA_VERSION=11
   ARG MAVEN_VERSION=3
   
   # Install Erlang
   ENV ERLANG_HOME=/usr/local/lib/erlang
   COPY --from="erlang:${ERLANG_VERSION}" "${ERLANG_HOME}" "${ERLANG_HOME}"
   ENV PATH="${ERLANG_HOME}/bin:${PATH}"
   
   # Install Elixir
   ENV ELIXIR_HOME=/usr/local/lib/elixir
   COPY --from="elixir:${ELIXIR_VERSION}-otp-${ERLANG_VERSION}" 
"${ELIXIR_HOME}" "${ELIXIR_HOME}"
   ENV PATH="${ELIXIR_HOME}/bin:${PATH}"
   
   # Install Java
   ENV JAVA_HOME=/opt/java/openjdk
   COPY --from="eclipse-temurin:${JAVA_VERSION}" "${JAVA_HOME}" "${JAVA_HOME}"
   ENV PATH="${JAVA_HOME}/bin:${PATH}"
   
   # Install Maven
   ENV MAVEN_HOME=/usr/share/maven
   COPY --from="maven:${MAVEN_VERSION}-eclipse-temurin-${JAVA_VERSION}" 
"${MAVEN_HOME}" "${MAVEN_HOME}"
   ENV PATH="${MAVEN_HOME}/bin:${PATH}"
   ```
   
   Would just need to be called with various `--build-arg="BASE=blah"` for all 
the OS's and arch's we seem to use.
   
   Obviously there isn't a similar trick for spidermonkey/icu/etc but the above 
covers the four big dependencies and in, I think?, a really efficient way? we 
just depend entirely on a previous docker image build effort from the upstream 
maintainers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to