Skip to content

Commit b8d4e7d

Browse files
committed
entrypoint-aws-batch: Allow overwriting of existing files during ZIP archive extraction
This allows Nextstrain CLI's --augur, --auspice, etc. overlays to start working with AWS Batch when previously they did not, by bundling them up with appropriate ../ path parts into the workdir ZIP archive. See "entrypoint-aws-batch: Keep ../ path parts in ZIP archive members during extraction" (e05ddfb) for the rationale of why this is not particularly unsafe.
1 parent e05ddfb commit b8d4e7d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,17 @@ COPY --from=builder-build-platform /usr/lib/node_modules/ /usr/lib/node_modules/
399399
# correctly discovered by node.
400400
RUN ln -sv /usr/lib/node_modules/auspice/auspice.js /usr/local/bin/auspice
401401

402+
# Setup a non-root user for optional use
403+
RUN useradd nextstrain \
404+
--system \
405+
--user-group \
406+
--shell /bin/bash \
407+
--home-dir /nextstrain \
408+
--no-log-init
409+
402410
# Add Nextstrain components
403-
COPY --from=builder-build-platform /nextstrain /nextstrain
404-
COPY --from=builder-target-platform /nextstrain /nextstrain
411+
COPY --from=builder-build-platform --chown=nextstrain:nextstrain /nextstrain /nextstrain
412+
COPY --from=builder-target-platform --chown=nextstrain:nextstrain /nextstrain /nextstrain
405413

406414
# Add our entrypoints and helpers
407415
COPY entrypoint entrypoint-aws-batch drop-privs create-envd delete-envd /sbin/
@@ -411,14 +419,6 @@ RUN chmod a+rx /sbin/entrypoint* /sbin/drop-privs /sbin/{create,delete}-envd
411419
RUN chmod a+rwXt /nextstrain
412420
ENV HOME=/nextstrain
413421

414-
# Setup a non-root user for optional use
415-
RUN useradd nextstrain \
416-
--system \
417-
--user-group \
418-
--shell /bin/bash \
419-
--home-dir /nextstrain \
420-
--no-log-init
421-
422422
# No nesting of runtimes, please. Use the ambient runtime inside this runtime.
423423
ENV NEXTSTRAIN_HOME=/nextstrain
424424
RUN nextstrain check-setup --set-default ambient \

entrypoint-aws-batch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -x
88
case "$NEXTSTRAIN_AWS_BATCH_WORKDIR_URL" in
99
s3://*.zip)
1010
aws s3 cp --no-progress "$NEXTSTRAIN_AWS_BATCH_WORKDIR_URL" "$PWD.zip"
11-
unzip -: "$PWD.zip"
11+
unzip -: -o "$PWD.zip"
1212
;;
1313
s3://*)
1414
# Note that this doesn't preserve file permissions/modes.

0 commit comments

Comments
 (0)