Skip to content

Commit

Permalink
update dockerfile and docker actions version in ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
daico007 committed Dec 4, 2023
1 parent b469cad commit a121efb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
python-version: python="3.10"
create-args: python="3.10"

- name: Clone mBuild and Foyer and forcefield-utilities
run: |
Expand Down Expand Up @@ -95,14 +95,14 @@ jobs:
runs-on: ubuntu-latest
needs: test
name: Build Docker Image
if: ${{ false }}
if: github.event_name != 'pull_request'

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand All @@ -122,7 +122,7 @@ jobs:
echo Docker Image tags: ${DOCKER_TAGS}
- name: Build and Push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.DOCKER_TAGS }}
36 changes: 27 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mambaorg/micromamba:1.4.3
ARG PY_VERSION=3.10
FROM continuumio/miniconda3:4.10.3-alpine AS builder

EXPOSE 8888

Expand All @@ -13,17 +14,34 @@ ADD . /gmso

WORKDIR /gmso

RUN apt-get update && apt-get install -y git
# Create a group and user
RUN addgroup -S anaconda && adduser -S anaconda -G anaconda

RUN apk update && apk add libarchive &&\
conda update conda -yq && \
conda config --set always_yes yes --set changeps1 no && \
. /opt/conda/etc/profile.d/conda.sh && \
sed -i -E "s/python.*$/python="$(PY_VERSION)"/" environment-dev.yml && \
conda install -c conda-forge mamba && \
mamba env create --file environment-dev.yml && \
conda activate gmso-dev && \
mamba install -c conda-forge jupyter python="$PY_VERSION" && \
python setup.py install && \
echo "source activate gmso-dev" >> \
/home/anaconda/.profile && \
conda clean -afy && \
mkdir -p /home/anaconda/data && \
chown -R anaconda:anaconda /gmso && \
chown -R anaconda:anaconda /opt && \
chown -R anaconda:anaconda /home/anaconda

RUN micromamba create --file environment-dev.yml && \
micromamba clean -afy
ARG MAMBA_DOCKERFILE_ACTIVATE=1 # (otherwise python will not be found)
WORKDIR /home/anaconda

RUN micromamba install -c conda-forge nomkl jupyter python="3.10" && \
python setup.py install && \
echo "source activate gmso-dev" >> /home/.bashrc && \
mkdir -p /home/data
COPY devtools/docker-entrypoint.sh /entrypoint.sh

RUN chmod a+x /entrypoint.sh

USER anaconda

ENTRYPOINT ["/entrypoint.sh"]
CMD ["jupyter"]

0 comments on commit a121efb

Please sign in to comment.