Skip to content

Commit

Permalink
Various improvements and adjustments to Dockerfile (#249)
Browse files Browse the repository at this point in the history
* Jupyter notebooks needs a lightweight init system to reap processes.
* Script to manually trigger circleci job that builds and pushes docker images.
* Don't put entire git commit into container build context.
* Split mandatory requirements from build tests.
* Allow OPTFLAGS to be passed to PETSc and SLEPc builds.
* Remove python2 after building PETSc/SLEPc.
* Allow user to pass MAKEFLAGS to ninja and cmake. Otherwise, default behaviour.
  • Loading branch information
jhale committed Nov 20, 2018
1 parent 525ad51 commit bbf4ddf
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 110 deletions.
13 changes: 6 additions & 7 deletions .circleci/config.yml
Expand Up @@ -183,22 +183,22 @@ jobs:
command: echo ${QUAYIO_TOKEN} | docker login -u ${QUAYIO_USERNAME} --password-stdin quay.io
- run:
name: Build and push dev-env-real Docker image tag dev-env-real
command: docker build --build-arg BUILD_THREADS=2 --target dev-env-real -t quay.io/fenicsproject/dolfinx:dev-env-real . && docker push quay.io/fenicsproject/dolfinx:dev-env-real
command: docker build --build-arg MAKEFLAGS='-j3' --target dev-env-real -t quay.io/fenicsproject/dolfinx:dev-env-real . && docker push quay.io/fenicsproject/dolfinx:dev-env-real
- run:
name: Build dev-env-complex Docker image tag dev-env-complex
command: docker build --build-arg BUILD_THREADS=2 --target dev-env-complex -t quay.io/fenicsproject/dolfinx:dev-env-complex . && docker push quay.io/fenicsproject/dolfinx:dev-env-complex
command: docker build --build-arg MAKEFLAGS='-j3' --target dev-env-complex -t quay.io/fenicsproject/dolfinx:dev-env-complex . && docker push quay.io/fenicsproject/dolfinx:dev-env-complex
- run:
name: Build real Docker image tags latest, real
command: docker build --build-arg BUILD_THREADS=2 --target real -t quay.io/fenicsproject/dolfinx:latest . && docker tag quay.io/fenicsproject/dolfinx:latest quay.io/fenicsproject/dolfinx:real && docker push quay.io/fenicsproject/dolfinx:latest && docker push quay.io/fenicsproject/dolfinx:real
command: docker build --build-arg MAKEFLAGS='-j3' --target real -t quay.io/fenicsproject/dolfinx:latest . && docker tag quay.io/fenicsproject/dolfinx:latest quay.io/fenicsproject/dolfinx:real && docker push quay.io/fenicsproject/dolfinx:latest && docker push quay.io/fenicsproject/dolfinx:real
- run:
name: Build complex Docker image tag complex
command: docker build --build-arg BUILD_THREADS=2 --target complex -t quay.io/fenicsproject/dolfinx:complex . && docker push quay.io/fenicsproject/dolfinx:complex
command: docker build --build-arg MAKEFLAGS='-j3' --target complex -t quay.io/fenicsproject/dolfinx:complex . && docker push quay.io/fenicsproject/dolfinx:complex
- run:
name: Build real notebook Docker image tag notebook
command: docker build --build-arg BUILD_THREADS=2 --target notebook -t quay.io/fenicsproject/dolfinx:notebook . && docker push quay.io/fenicsproject/dolfinx:notebook
command: docker build --build-arg MAKEFLAGS='-j3' --target notebook -t quay.io/fenicsproject/dolfinx:notebook . && docker push quay.io/fenicsproject/dolfinx:notebook
- run:
name: Build complex notebook Docker image tag notebook-complex
command: docker build --build-arg BUILD_THREADS=2 --target notebook-complex -t quay.io/fenicsproject/dolfinx:notebook-complex . && docker push quay.io/fenicsproject/dolfinx:notebook-complex
command: docker build --build-arg MAKEFLAGS='-j3' --target notebook-complex -t quay.io/fenicsproject/dolfinx:notebook-complex . && docker push quay.io/fenicsproject/dolfinx:notebook-complex

workflows:
version: 2
Expand All @@ -214,7 +214,6 @@ workflows:
only:
- master

version: 2
biweekly:
triggers:
- schedule:
Expand Down
4 changes: 4 additions & 0 deletions .circleci/trigger-circleci-build-and-push-docker-images.sh
@@ -0,0 +1,4 @@
#!/bin/bash
curl -u ${CIRCLE_API_USER_TOKEN} \
-d build_parameters[CIRCLE_JOB]=build-and-push-docker-images \
https://circleci.com/api/v1.1/project/github/FEniCS/dolfinx/tree/master
1 change: 1 addition & 0 deletions .dockerignore
@@ -0,0 +1 @@
.git

0 comments on commit bbf4ddf

Please sign in to comment.