Skip to content

Commit

Permalink
working dev container with poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Nov 19, 2023
1 parent 11be82f commit b624c1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
35 changes: 17 additions & 18 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dolfinx/dolfinx:v0.7.0
FROM dolfinx/dolfinx:v0.6.0
# FROM mcr.microsoft.com/devcontainers/base:jammy
ARG DEBIAN_FRONTEND=noninteractive
# RUN useradd -ms /bin/bash vscode
Expand All @@ -25,23 +25,22 @@ RUN DEBIAN_FRONTEND=noninteractive \
libffi-dev \
liblzma-dev

# Python and poetry installation
USER $USER
ARG HOME="/home/$USER"
# # Python and poetry installation
# # USER $USER
# # ARG HOME="/home/$USER"

# Don't change. Dolfinx in the base image is only compiled with 3.10
ARG PYTHON_VERSION=3.10

# Use poetry pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
# # Don't change. Dolfinx in the base image is only compiled with 3.10
# #ARG PYTHON_VERSION=3.10.6

# # Use poetry pyenv
# #ENV PYENV_ROOT="${HOME}/.pyenv"
# #ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:/root/.local/bin:$PATH"
ENV PATH="/root/.local/bin:$PATH"
RUN echo "done 0" \
&& curl https://pyenv.run | bash \
&& echo "done 1" \
&& pyenv install ${PYTHON_VERSION} \
&& echo "done 2" \
&& pyenv global ${PYTHON_VERSION} \
&& echo "done 3" \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& poetry config virtualenvs.in-project true
# # && curl https://pyenv.run | bash \
# # && echo "done 1" \
# # && pyenv install ${PYTHON_VERSION} \
# # && echo "done 2" \
# # && pyenv global ${PYTHON_VERSION} \
# # && echo "done 3" \
&& curl -sSL https://install.python-poetry.org | python3 -
4 changes: 3 additions & 1 deletion .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
poetry config virtualenvs.create false
poetry env use system
poetry install --with dev --no-interaction
poetry run pip install petsc4py==3.20.0 mpi4py==3.1.5 https://github.com/FEniCS/ufl/archive/refs/tags/2023.2.0.zip https://github.com/FEniCS/ffcx/archive/v0.7.0.zip https://github.com/FEniCS/basix/archive/v0.7.0.zip
#poetry run pip install petsc4py==3.20.0 mpi4py==3.1.5 https://github.com/FEniCS/ufl/archive/refs/tags/2023.2.0.zip https://github.com/FEniCS/ffcx/archive/v0.7.0.zip https://github.com/FEniCS/basix/archive/v0.7.0.zip

0 comments on commit b624c1a

Please sign in to comment.