Skip to content

Commit

Permalink
Add Nextclade v2 conditionally on platform
Browse files Browse the repository at this point in the history
Nextclade/Nextalign v2 comes with pre-built binaries for multiple
platforms. Use TARGETPLATFORM [1] to construct URLs for each platform.

[1]: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
  • Loading branch information
victorlin authored Sep 14, 2022
1 parent 22fb1cb commit 401506e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,24 @@ COPY --from=builder \
COPY --from=builder /build/vcftools/built/bin/ /usr/local/bin/
COPY --from=builder /build/vcftools/built/share/ /usr/local/share/

ARG TARGETPLATFORM

# use /env to persist variable across RUNs
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "export NEXTCLADE_PLATFORM=x86_64-unknown-linux-gnu" >> /env; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then echo "export NEXTCLADE_PLATFORM=aarch64-unknown-linux-gnu" >> /env; fi

# Add Nextalign v2
RUN curl -fsSL https://github.com/nextstrain/nextclade/releases/latest/download/nextalign-x86_64-unknown-linux-gnu \
RUN . /env; curl -fsSL https://github.com/nextstrain/nextclade/releases/latest/download/nextalign-$NEXTCLADE_PLATFORM \
--output /usr/local/bin/nextalign2 \
&& chmod a+rx /usr/local/bin/nextalign2

# Add Nextclade v2
RUN curl -fsSL https://github.com/nextstrain/nextclade/releases/latest/download/nextclade-x86_64-unknown-linux-gnu \
RUN . /env; curl -fsSL https://github.com/nextstrain/nextclade/releases/latest/download/nextclade-$NEXTCLADE_PLATFORM \
--output /usr/local/bin/nextclade2 \
&& chmod a+rx /usr/local/bin/nextclade2

RUN rm /env

# Add Nextalign v1
RUN curl -fsSL https://github.com/nextstrain/nextclade/releases/download/1.11.0/nextalign-Linux-x86_64 \
--output /usr/local/bin/nextalign1 \
Expand Down

0 comments on commit 401506e

Please sign in to comment.