Skip to content

Commit

Permalink
Optimize layers, remove commented lines, and include Ruby
Browse files Browse the repository at this point in the history
Addresses Tom's comments about how to optimize the Dockerfile. This commit will
be squashed into the original commit on rebase.
  • Loading branch information
huddlej committed Mar 7, 2020
1 parent e935646 commit 0df5721
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ FROM python:3.7-slim-buster AS builder
SHELL ["/bin/bash", "-c"]

# Add system deps for building
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
Expand All @@ -23,7 +22,6 @@ RUN apt-get install -y --no-install-recommends \
libpng-dev \
nodejs \
npm \
perl \
pkg-config

# Downloading dependencies, these should be pinned to specific versions
Expand Down Expand Up @@ -74,9 +72,6 @@ ARG CACHE_DATE
# Add download helper
COPY devel/download-repo /devel/

# # sacra
# RUN /devel/download-repo https://github.com/nextstrain/sacra master /nextstrain/sacra

# fauna
RUN /devel/download-repo https://github.com/nextstrain/fauna master /nextstrain/fauna

Expand All @@ -86,9 +81,6 @@ RUN /devel/download-repo https://github.com/nextstrain/augur release /nextstrain
# auspice
RUN /devel/download-repo https://github.com/nextstrain/auspice release /nextstrain/auspice

# # Install Python 2 deps
# RUN pip2 install --requirement=/nextstrain/sacra/requirements.txt

# Install Python 3 deps
RUN pip3 install --requirement=/nextstrain/fauna/requirements.txt

Expand All @@ -110,27 +102,23 @@ RUN pip3 install seaborn==0.9.0
# hot-reloading, which is time-consuming and generally unnecessary in the
# container image. Linking is equivalent to an editable Python install and
# used for the same reasons described above.
RUN cd /nextstrain/auspice && npm install && npm run build && npm link

RUN apt-get clean
RUN cd /nextstrain/auspice && npm update && npm install && npm run build && npm link

# ———————————————————————————————————————————————————————————————————— #

# Now build the final image.
FROM python:3.7-slim-buster

# Add system runtime deps
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gzip \
nodejs \
ruby \
wget \
zip unzip

RUN apt-get clean

# Configure the prompt for interactive usage
COPY prompt.sh /etc/profile.d/

Expand All @@ -151,7 +139,6 @@ COPY --from=builder /build/vcftools/built/share/ /usr/local/share/
RUN chmod a+rX /usr/local/bin/* /usr/local/libexec/*

# Add installed Python libs
# COPY --from=builder /usr/lib/python2.7/site-packages/ /usr/lib/python2.7/site-packages/
COPY --from=builder /usr/local/lib/python3.7/site-packages/ /usr/local/lib/python3.7/site-packages/

# Add installed Python scripts that we need.
Expand Down

0 comments on commit 0df5721

Please sign in to comment.