Skip to content

Commit

Permalink
feat(docker): Use Carton to lock dependencies in docker image
Browse files Browse the repository at this point in the history
- Set entrypoint to always execute mip using locked dependencies
  • Loading branch information
henrikstranneheim committed Dec 6, 2020
1 parent 3f8774b commit e3baf6a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Dockerfile
Expand Up @@ -8,7 +8,7 @@ LABEL base_image="perl:5.26"
LABEL version="1"
LABEL software="MIP"
LABEL software.version="5.26"
LABEL extra.binaries="mip, perl, prove, cpanm"
LABEL extra.binaries="mip, perl, prove, cpanm, carton"
LABEL maintainer="Clinical-Genomics/MIP"

RUN apt-get update && apt-get install -y --no-install-recommends locales locales-all \
Expand All @@ -19,15 +19,21 @@ ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN cpanm install Carton

# Add MIP into image
ENV MIP_INSTALL_DIR=/workspace/bin
COPY . "$MIP_INSTALL_DIR"
WORKDIR "$MIP_INSTALL_DIR"

# Install MIP dependencies for CPANM modules
RUN cpanm -f Net::DNS
RUN cpanm --installdeps .

# Make executable and add to binary to PATH
RUN chmod a+x "$MIP_INSTALL_DIR/mip"
ENV PATH "$PATH:$MIP_INSTALL_DIR"
ENV PATH "$PATH:$MIP_INSTALL_DIR"

# Remove any outside local from previous carton installs
RUN rm -rf local

RUN carton install

RUN carton install --deployment

ENTRYPOINT ["carton", "exec"]

0 comments on commit e3baf6a

Please sign in to comment.