Skip to content

Commit

Permalink
Try adding Ubuntu stage to publish Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterius committed Oct 17, 2024
1 parent 440ac86 commit 348f23d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Deploy on GitHub Pages
- name: Publish to GitHub Pages
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
Expand Down
23 changes: 15 additions & 8 deletions env/publish/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN apt-get update \
ca-certificates \
curl \
&& apt-get clean

RUN mkdir -p /opt/quarto \
&& curl -o quarto.tar.gz -L "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-${TARGETARCH}.tar.gz" \
&& tar -zxvf quarto.tar.gz -C /opt/quarto/ --strip-components=1 \
Expand All @@ -18,22 +17,27 @@ RUN mkdir -p /opt/quarto \
#
# Second stage: Conda environment
#
FROM condaforge/miniforge3:24.7.1-0
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.description="Dockerfile for the Tools for Reproducible Research NBIS / Elixir workshop"
COPY --from=quarto /opt/quarto /opt/quarto
ENV PATH="${PATH}:/opt/quarto/bin"
FROM condaforge/miniforge3:24.7.1-0 AS conda
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pkg-config \
&& apt-get clean

# Copy and install the Conda environment
COPY environment.yml ./
RUN conda config --set channel_priority strict \
&& conda env update --name base --file environment.yml \
&& conda clean --all --force-pkgs-dirs --yes

#
# Third stage: Final image
#
FROM ubuntu:20.04
COPY --from=quarto /opt/quarto /opt/quarto
COPY --from=conda /opt/conda /opt/conda/
ENV PATH="${PATH}:/opt/quarto/bin:/opt/conda/bin"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates

# Use bash as shell
SHELL ["/bin/bash", "-c"]

Expand All @@ -42,3 +46,6 @@ WORKDIR /work

# Start Bash shell by default
CMD /bin/bash

LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.description="Dockerfile for the Tools for Reproducible Research NBIS / Elixir workshop"
3 changes: 1 addition & 2 deletions env/publish/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ channels:
dependencies:

# Command line
- gh
- jq
- git
- snakemake-minimal

# R
Expand Down

0 comments on commit 348f23d

Please sign in to comment.