Skip to content

Commit

Permalink
Merge pull request #190 from jpedroh/feat-add-docker
Browse files Browse the repository at this point in the history
Add Docker image configuration
  • Loading branch information
pauloborba authored Jun 11, 2024
2 parents cff0f89 + 6835d04 commit 0219e1a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,34 @@ jobs:
run: ./gradlew assemble
- name: Gradle check
run: ./gradlew check --info
docker:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
attestations: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM amazoncorretto:8 as build

WORKDIR /usr/src/miningframework

COPY . .

RUN ./gradlew installDist

FROM amazoncorretto:8

WORKDIR /usr/src/miningframework

RUN yum -y update
RUN yum -y install git

COPY --from=build /usr/src/miningframework/build /usr/local/bin/miningframework
RUN chmod +x /usr/local/bin/miningframework/install/miningframework/bin/miningframework

ENV PATH="/usr/local/bin/miningframework/install/miningframework/bin:${PATH}"

ENTRYPOINT ["miningframework"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ For those, the order which the they are injected will be followed by the framewo
The framework uses [Google Guice](https://github.com/google/guice) to implement dependency injection, and inject the interface implementations.
So, to select the interface implementations you want to use in your desired instantiation of the framework, you also need to write a class such as [StaticAnalysisConflictsDetectionModule](https://github.com/spgroup/miningframework/blob/master/src/main/injectors/StaticAnalysisConflictsDetectionModule.groovy) in the injectors package, which acts as the dependency injector. This one, in particular, is used as a default injector if no other is specified when invoking the framework.

## Running Mining Framework with Docker

If you have Docker available on your machine, you might find it easier to start playing with Mining Framework by using our pre-built Docker image.

The image is built upon [Amazon Corretto](https://hub.docker.com/_/amazoncorretto) with Java 8, and provides an already compiled distribution of Mining Framework. To start running it with Docker, simply run:

```
docker run -v $PWD/output:/usr/src/miningframework/output/ -v $PWD/projects.csv:/usr/src/miningframework/projects.csv --rm ghcr.io/spgroup/miningframework:master projects.csv
```

## Running a specific framework instantiation

Expand Down

0 comments on commit 0219e1a

Please sign in to comment.