FROM eclipse-temurin:17-jdk AS build WORKDIR /opt/nextflow COPY . /opt/nextflow RUN chmod +x ./gradlew ./launch.sh ./nextflow || true RUN ./gradlew clean assemble exportClasspath RUN mkdir -p /opt/nextflow-runtime/lib \ && i=0; \ tr ':' '\n' < /opt/nextflow/.launch.classpath | while read -r path; do \ if [ -f "$path" ]; then \ name="$(basename "$path")"; \ target="/opt/nextflow-runtime/lib/$name"; \ runtime_path="/opt/nextflow/lib/$name"; \ if [ -e "$target" ]; then \ i=$((i+1)); \ target="/opt/nextflow-runtime/lib/${i}-$name"; \ runtime_path="/opt/nextflow/lib/${i}-$name"; \ fi; \ cp "$path" "$target"; \ echo "$runtime_path" >> /opt/nextflow-runtime/.launch.classpath.lines; \ fi; \ done \ && paste -sd ':' /opt/nextflow-runtime/.launch.classpath.lines > /opt/nextflow-runtime/.launch.classpath RUN mkdir -p /opt/nextflow-runtime/plugins \ && cp /opt/nextflow/launch.sh /opt/nextflow-runtime/launch.sh \ && cp /opt/nextflow/nextflow /opt/nextflow-runtime/nextflow \ && cp -a /opt/nextflow/plugins/nf-k8s /opt/nextflow-runtime/plugins/nf-k8s FROM eclipse-temurin:17-jre WORKDIR /opt/nextflow COPY --from=build /opt/nextflow-runtime /opt/nextflow RUN chmod +x /opt/nextflow/launch.sh \ && cp /opt/nextflow/launch.sh /opt/nextflow/nextflow \ && chmod +x /opt/nextflow/nextflow \ && echo "nextflow-dvfs-dev-image 0.1" > /opt/nextflow/DEV_IMAGE_MARKER RUN mkdir -p /opt/nextflow/conf \ && cat > /opt/nextflow/conf/scm <<'EOF' providers { mygitea { platform = 'gitea' server = 'https://gitea.kleine.eulenhexe.de' endpoint = 'https://gitea.kleine.eulenhexe.de/api/v1' } } EOF ENV PATH="/opt/nextflow:${PATH}" ENV NXF_HOME="/tmp/.nextflow" ENV NXF_PLUGINS_MODE="dev" ENV NXF_PLUGINS_DIR="/opt/nextflow/plugins" ENV NXF_SCM_FILE="/opt/nextflow/conf/scm" ENTRYPOINT ["/opt/nextflow/launch.sh"]