Skip to content

Commit

Permalink
Rebuild from bmi base image
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Sep 2, 2024
1 parent 0bd0e27 commit 1fabd9a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Build the Python BMI example from a Mambaforge (Linux/Ubuntu) image.
FROM condaforge/mambaforge:24.3.0-0
FROM csdms/bmi:0.1.0

LABEL author="Mark Piper"
LABEL email="mark.piper@colorado.edu"

ENV prefix=/opt/bmi-example-python
ENV base_url=https://github.com/csdms
ENV package=bmi-example-python
ENV version="2.1.2"
ENV prefix=/opt/${package}

RUN git clone --branch v${version} https://github.com/csdms/bmi-example-python ${prefix}
RUN git clone --branch v${version} ${base_url}/${package} ${prefix}
WORKDIR ${prefix}
RUN mamba install -y --file requirements.txt
RUN pip install .
RUN mamba install -y --file requirements.txt --file requirements-testing.txt
RUN pip install .[testing]
RUN pytest

WORKDIR /opt
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ The [Python example](https://github.com/csdms/bmi-example-python)
for the [Basic Model Interface](https://bmi.readthedocs.io),
dockerized.

## Build an image
## Build the image

Build this example locally with:
```
docker build --tag bmi-example-python .
```
The image is built on the [condaforge/mambaforge](https://hub.docker.com/r/condaforge/mambaforge) base image.
The image is based on the [csdms/bmi](https://hub.docker.com/r/csdms/bmi) image.
The OS is Linux/Ubuntu.
`conda` and `mamba` are installed in `opt/conda`.
The *base* environment is activated,
and the Python BMI example is installed into it.
`conda` and `mamba` are installed in `CONDA_DIR=opt/conda`,
and the *base* environment is activated.
The Python BMI specification and example are installed into it.

## Run a container

Expand Down Expand Up @@ -51,11 +51,16 @@ Copy/paste this URL into a browser to view and run the example notebooks.
## Developer notes

A versioned, multiplatform image built from this repository is hosted on Docker Hub
at [csdms/bmi-example-python](https://hub.docker.com/repository/docker/csdms/bmi-example-python/).
This image is automatically built and pushed to Docker Hub
with the [release](./.github/workflows/release.yml) CI workflow.
The workflow is only run when the repository is tagged.
at [csdms/bmi-example-python](https://hub.docker.com/r/csdms/bmi-example-python/).
When this repository is tagged,
an image is automatically built and pushed to Docker Hub
by the [release](./.github/workflows/release.yml) CI workflow.
To manually build and push an update, run:
```
docker buildx build --platform linux/amd64,linux/arm64 -t csdms/bmi-example-python:latest --push .
```
A user can pull this image from Docker Hub with:
```
docker pull csdms/bmi-example-python
```
optionally with the `latest` tag or with a version tag.

0 comments on commit 1fabd9a

Please sign in to comment.