Skip to content

Commit

Permalink
healthcheck bug fix and add podman compatibility (#68)
Browse files Browse the repository at this point in the history
* healthcheck bug fix and add podman compatibility

Signed-off-by: Matt Colman <[email protected]>

* fixed typo

Signed-off-by: Matt Colman <[email protected]>

---------

Signed-off-by: Matt Colman <[email protected]>
  • Loading branch information
mtcolman authored Nov 13, 2024
1 parent a40f9b5 commit 1f59a06
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# extract cbomkit version tag from pom.xml
VERSION := $(shell curl -s https://api.github.com/repos/IBM/cbomkit/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# set engine to use for build and compose, default to docker
ENGINE ?= docker
# build the backend
build-backend: dev
./mvnw clean package
# build the docker image for the backend
# build the container image for the backend
build-backend-image: build-backend
docker build \
$(ENGINE) build \
-t cbomkit:${VERSION} \
-f src/main/docker/Dockerfile.jvm \
. \
--load
# build the docker image for the frontend
# build the container image for the frontend
build-frontend-image:
docker build \
$(ENGINE) build \
-t cbomkit-frontend:${VERSION} \
-f frontend/docker/Dockerfile \
./frontend \
--load
# run the dev setup using docker compose
# run the dev setup using docker/podman compose
dev:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit docker-compose --profile dev up -d
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit $(ENGINE)-compose --profile dev up -d
dev-backend:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit docker-compose --profile dev-backend up
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit $(ENGINE)-compose --profile dev-backend up
dev-frontend:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit docker-compose --profile dev-frontend up
# run the prod setup using docker compose
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit $(ENGINE)-compose --profile dev-frontend up
# run the prod setup using $(ENGINE) compose
production:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit docker-compose --profile prod up
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit $(ENGINE)-compose --profile prod up
coeus:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=true docker-compose --profile viewer up
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=true $(ENGINE)-compose --profile viewer up
ext-compliance:
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit docker-compose --profile ext-compliance up
env CBOMKIT_VERSION=${VERSION} CBOMKIT_VIEWER=false POSTGRESQL_AUTH_USERNAME=cbomkit POSTGRESQL_AUTH_PASSWORD=cbomkit $(ENGINE)-compose --profile ext-compliance up
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ git clone https://github.com/IBM/cbomkit
# run the make command to start the docker compose
make production
```

Alternatively, if you wish to use podman instead of docker, run the following:
```
# run the make command to start the docker compose using podman
make production ENGINE=podman
```

(This requires podman-compose to have been installed via `pip3 install podman-compose`).

Next steps:
- Enter a git url like [https://github.com/keycloak/keycloak](https://github.com/keycloak/keycloak) to generate a CBOM
- View your generated CBOM by selecting your previously scanned CBOM
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ services:
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready -U postgres" ]
test: [ "CMD", "pg_isready -U ${POSTGRESQL_AUTH_USERNAME} -d postgres" ]
interval: 10s
timeout: 5s
retries: 5
Expand Down

0 comments on commit 1f59a06

Please sign in to comment.