@@ -28,6 +28,7 @@ COPY --from=xx / /
2828# make: used for building from Makefiles (search for usage); may be used by package managers to build from source
2929# nodejs: for installing Auspice
3030# clang: for compiling C/C++ projects; may be used by package managers to build from source
31+ # unzip: for AWS CLI
3132RUN apt-get update && apt-get install -y --no-install-recommends \
3233 autoconf \
3334 automake \
@@ -36,7 +37,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3637 curl \
3738 git \
3839 make \
39- dpkg-dev
40+ dpkg-dev \
41+ unzip
4042
4143# Install a specific Node.js version
4244# https://github.com/nodesource/distributions/blob/ba48c1fe6e843e9ffb60aefc5da5d00234c83f04/README.md#using-debian-as-root-nodejs-20
@@ -208,6 +210,14 @@ RUN curl -fsSL https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-$
208210RUN curl -fsSL https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-${TARGETARCH}/dataformat \
209211 -o /final/bin/dataformat
210212
213+ # Install tooling for our AWS Batch builds, which use `aws s3`.
214+ # Using `xx-info march` to translate amd64 -> x86_64 and arm64 -> aarch64
215+ # based on https://github.com/docker/buildx/discussions/2001
216+ RUN XX_MARCH=$(xx-info march) \
217+ && curl -fsSL --proto '=https' "https://awscli.amazonaws.com/awscli-exe-linux-${XX_MARCH}.zip" -o "awscliv2.zip" \
218+ && unzip awscliv2.zip "aws/dist/*" -d /final/libexec/aws-cli \
219+ && ln -srv /final/libexec/aws-cli/aws/dist/aws /final/bin/aws
220+
211221# ———————————————————————————————————————————————————————————————————— #
212222
213223# Define a builder stage that runs on the target platform.
@@ -244,11 +254,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
244254# Install envdir, which is used by pathogen builds
245255RUN pip3 install envdir==1.0.1
246256
247- # Install tooling for our AWS Batch builds, which use `aws s3`.
248- RUN python3 -m venv /usr/local/libexec/awscli \
249- && /usr/local/libexec/awscli/bin/python -m pip install awscli==1.18.195 \
250- && ln -sv /usr/local/libexec/awscli/bin/aws /usr/local/bin/aws
251-
252257# Install Snakemake and related optional dependencies.
253258# Pinned to 9.17.0 for stability, latest guaranteed compatible version
254259# based on <https://github.com/nextstrain/public/issues/39>
@@ -389,9 +394,6 @@ RUN chmod a+rx /usr/local/bin/* /usr/local/libexec/*
389394# Add installed Python libs
390395COPY --from=builder-target-platform /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
391396
392- # AWS CLI
393- COPY --from=builder-target-platform /usr/local/libexec/awscli/ /usr/local/libexec/awscli/
394-
395397# Add installed Python scripts that we need.
396398#
397399# XXX TODO: This isn't great. It's prone to needing manual updates because it
@@ -403,7 +405,6 @@ COPY --from=builder-target-platform /usr/local/libexec/awscli/ /usr/local/libexe
403405# -trs, 15 June 2018
404406COPY --from=builder-target-platform \
405407 /usr/local/bin/augur \
406- /usr/local/bin/aws \
407408 /usr/local/bin/bio \
408409 /usr/local/bin/envdir \
409410 /usr/local/bin/evofr \
0 commit comments