Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kohanlee1995 committed Dec 6, 2023
1 parent e5676f3 commit f86d766
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Docker

on:
push:
branches: [ "master", "wi24" ]
branches: [ "master", "*" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
paths-ignore:
Expand Down Expand Up @@ -88,6 +88,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
target: builder
build-args: |
"modulename=${{ matrix.modulename }}"
40 changes: 6 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
# BUILDER CONTAINER
FROM condaforge/mambaforge:4.14.0-0 as builder

ARG modulename

COPY ${modulename}.yml /docker/environment.yml

RUN . /opt/conda/etc/profile.d/conda.sh && \
mamba create --name lock && \
conda activate lock && \
mamba env list && \
mamba install --yes pip conda-lock>=1.2.2 setuptools wheel && \
conda-lock lock \
--platform linux-64 \
--file /docker/environment.yml \
--kind lock \
--lockfile /docker/conda-lock.yml

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate lock && \
conda-lock install \
--mamba \
--copy \
--prefix /opt/env \
/docker/conda-lock.yml


# PRODUCTION (AKA PRIMARY) CONTAINER
FROM ucsdets/datahub-base-notebook:2023.1-stable as primary
FROM ucsdets/datahub-base-notebook:2023.1-stable

USER root

ARG modulename

RUN sed -i 's:^path-exclude=/usr/share/man:#path-exclude=/usr/share/man:' \
/etc/dpkg/dpkg.cfg.d/excludes

Expand All @@ -53,8 +27,6 @@ RUN apt-get update && apt-get install -y \
RUN conda config --set channel_priority strict && \
mamba install -y -n base -c conda-forge --override-channels bash_kernel nb_conda_kernels

#KEEP THIS COMMENT LINE - it is replaced dynamically within github actions to install each of the modules

RUN yes | unminimize || echo "done"

USER $NB_USER
COPY ${modulename}.yml /tmp
RUN mamba env create --file /tmp/${modulename}.yml && \
mamba clean -afy

0 comments on commit f86d766

Please sign in to comment.