Skip to content

Commit

Permalink
Fix: Fix the Dockerfile and the README.md (#593)
Browse files Browse the repository at this point in the history
* Fix: Fix the Dockerfile and the README.md

The versions used in the Dockerfile as well as the README.md didnt seems
to be up to date.
I also add the build part for the Dockerfile. This would help to be
independant from any previous java/maven installation on the the build
host.

Signed-off-by: Julien Godin <[email protected]>

* feature(git) Add git as it seems needed by magpie for the rules

Signed-off-by: Julien Godin <[email protected]>

* feat: add docker-compose.yaml

Signed-off-by: Julien Godin <[email protected]>

---------

Signed-off-by: Julien Godin <[email protected]>
  • Loading branch information
JGodin-C2C authored Apr 18, 2024
1 parent b75dc0d commit 56793c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM openjdk:11.0.11-jre
COPY magpie-cli/target/magpie*.tar.gz /
FROM maven:3.9.6-amazoncorretto-21-debian-bookworm as builder
RUN mkdir /build/
COPY ./ /build/
RUN ls -al /build/
RUN cd /build/ && mvn clean install -DskipTests && mvn --projects magpie-cli assembly:single -DskipTests

FROM openjdk:17.0.2-slim-bullseye
COPY --from=builder /build/magpie-cli/target/*.tar.gz /tmp/
RUN mkdir /magpie
RUN tar -zxvf *.tar.gz --strip-components=1 -C magpie
RUN tar -zxvf /tmp/*.tar.gz --strip-components=1 -C magpie
RUN apt update && apt install -y git && apt clean all
WORKDIR /magpie
CMD []
ENTRYPOINT ["./magpie.sh"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ each layer may exist on separate compute instances.
```shell
git clone [email protected]:openraven/magpie.git
cd magpie
mvn clean package install -DskipTests && mvn --projects magpie-cli assembly:single -DskipTests
mvn clean install -DskipTests && mvn --projects magpie-cli assembly:single -DskipTests
```

The distribution zip file will be located in `magpie-cli/target/magpie-<version>.zip`
Expand All @@ -63,7 +63,7 @@ the `uberjar` profile as such:

## Running Magpie

*Java 11 is a prerequisite and must be installed to run Magpie.*
*Java 17 is a prerequisite and must be installed to run Magpie.*

Out of the box Magpie supports AWS for the cloud provider and outputs discovery data to `stdout` in JSON format. The
AWS plugin utilizes the AWS Java SDK and will search for credentials as described in [Using Credentials](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html).
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
version: "3.8"
services:
magpie:
image: magpie:latest
entrypoint:
- /bin/bash
- -c
- sleep infinity
volumes:
# PLEASE CHANGE THE PATH TO THE CONFIG FILE
- ./magpie-cli/src/assembly/files/config.yaml:/magpie/config.yaml
database:
image: postgres:16
environment:
POSTGRES_PASSWORD: magpie
POSTGRES_USER: magpie
POSTGRES_DB: magpie

0 comments on commit 56793c2

Please sign in to comment.