Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile #789

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading