Skip to content

Commit d473343

Browse files
authored
Merge pull request #39 from factorhouse/feature/dockerfile-improvements
Dockerfile improvements
2 parents c3ab549 + 01c7d9e commit d473343

File tree

14 files changed

+104
-125
lines changed

14 files changed

+104
-125
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ jobs:
7070
VERSION="${VERSION//./-}"
7171
aws s3 cp target/kpow-java17-standalone.jar s3://${{ secrets.RELEASES_BUCKET }}/kpow-$VERSION-java17.jar
7272
73+
- name: Release Kpow JDK8 Community JAR
74+
run: |
75+
VERSION=${{github.event.inputs.version}}
76+
VERSION="${VERSION//./-}"
77+
aws s3 cp target/kpow-ce-java8-standalone.jar s3://${{ secrets.RELEASES_BUCKET }}/kpow-ce-$VERSION-java8.jar
78+
7379
- name: Release Dependency Check Report
7480
run: |
7581
VERSION=${{github.event.inputs.version}}
@@ -123,6 +129,12 @@ jobs:
123129
IMAGE_TAG=$VERSION-rh-ubi
124130
./scripts/build_amd64.sh $VERSION $IMAGE_ID $IMAGE_TAG dockerfile/rh-ubi/Dockerfile
125131
132+
- name: Build Kpow Community
133+
run: |
134+
NEXT_RELEASE=${{github.event.inputs.version}}
135+
docker buildx build -f ./dockerfile/kpow-ce/Dockerfile --platform=linux/amd64,linux/arm64 -t factorhouse/kpow-ce:latest --push .
136+
docker buildx build -f ./dockerfile/kpow-ce/Dockerfile --platform=linux/amd64,linux/arm64 -t factorhouse/kpow-ce:$NEXT_RELEASE --push .
137+
126138
- name: Deploy OpenAPI spec
127139
run: |
128140
VERSION=${{github.event.inputs.version}}
@@ -142,15 +154,25 @@ jobs:
142154
run: |
143155
aws s3 cp docs/releases-ee.edn s3://${{ secrets.RELEASES_BUCKET }}/releases-kpow-ee.edn \
144156
--cache-control no-cache --content-type application/edn
145-
- name: Commit
146-
run: |
147-
git config --global user.email "[email protected]"
148-
git config --global user.name "Kpow CI"
149-
git commit -am "Release Enterprise ${{github.event.inputs.version}}"
150-
- name: Tag
151-
run: git tag -a ee/${{github.event.inputs.version}} -m "Release Enterprise ${{github.event.inputs.version}}"
152-
- name: Push changes
153-
uses: ad-m/github-push-action@master
157+
- name: Update releases-ce.edn
158+
run: ./scripts/release.clj ${{github.event.inputs.version}} releases-ce.edn
159+
- name: Update dockerhub/kpow-ce/README.md
160+
run: echo ${{github.event.inputs.version}} | ./scripts/dockerhub_readme_kpow_ce.clj
161+
- name: Deploy Manifest to s3 (community)
162+
run: |
163+
aws s3 cp docs/releases-ce.edn s3://${{ secrets.RELEASES_BUCKET }}/releases-kpow-ce.edn \
164+
--cache-control no-cache --content-type application/edn
165+
- name: Commit and push
166+
run: |
167+
git config user.name "github-actions[bot]"
168+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
169+
git commit -am "Release ${{github.event.inputs.version}}"
170+
git push origin main
171+
- name: Create GitHub Release
172+
uses: softprops/action-gh-release@v2
154173
with:
155-
github_token: ${{ secrets.GITHUB_TOKEN }}
156-
branch: ${{ github.ref }}
174+
tag_name: ${{github.event.inputs.version}}
175+
name: ${{github.event.inputs.version}}
176+
body: "Visit https://factorhouse.io/kpow/releases for release details"
177+
draft: false
178+
prerelease: false

.github/workflows/release_ce.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

dockerfile/aws-mkt-lm/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ LABEL name="Kpow for Apache Kafka" \
1111
summary="Kpow is a toolkit for engineers who build, manage, and maintain systems powered by Apache Kafka." \
1212
description="Kpow features a rich data-oriented UI, specialized dashboards that deliver instant visibility into Kafka Clusters, Schema Registries, and Connect Installations, and developer tools that allow engineers to get to the heart of their systems quickly."
1313

14-
ADD --chmod=044 resources/eula.txt /licenses/eula.txt
15-
ADD --chmod=044 target/kpow-aws-mkt-lm-standalone.jar /opt/factorhouse/lib/kpow.jar
14+
COPY resources/eula.txt /licenses/eula.txt
15+
COPY target/kpow-aws-mkt-lm-standalone.jar /opt/factorhouse/lib/kpow.jar
16+
COPY entrypoint.sh /usr/local/bin/kpow.sh
1617

17-
ENV CORE_ASYNC_POOL_SIZE=8
18-
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70 --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED"
18+
RUN chown -R 1001:1001 /opt/factorhouse
1919

2020
EXPOSE 3000
2121

22-
CMD java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar
22+
USER 1001
23+
24+
ENV CORE_ASYNC_POOL_SIZE=8
25+
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70"
26+
27+
CMD ["/usr/local/bin/kpow.sh"]

dockerfile/aws-mkt-lm/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
exec java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar

dockerfile/aws-mkt-pro/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ LABEL name="Kpow for Apache Kafka" \
1111
summary="Kpow is a toolkit for engineers who build, manage, and maintain systems powered by Apache Kafka." \
1212
description="Kpow features a rich data-oriented UI, specialized dashboards that deliver instant visibility into Kafka Clusters, Schema Registries, and Connect Installations, and developer tools that allow engineers to get to the heart of their systems quickly."
1313

14-
ADD --chmod=044 resources/eula.txt /licenses/eula.txt
15-
ADD --chmod=044 target/kpow-aws-mkt-pro-standalone.jar /opt/factorhouse/lib/kpow.jar
14+
COPY resources/eula.txt /licenses/eula.txt
15+
COPY target/kpow-aws-mkt-pro-standalone.jar /opt/factorhouse/lib/kpow.jar
16+
COPY entrypoint.sh /usr/local/bin/kpow.sh
1617

17-
ENV CORE_ASYNC_POOL_SIZE=8
18-
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70 --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED"
18+
RUN chown -R 1001:1001 /opt/factorhouse
1919

2020
EXPOSE 3000
2121

22-
CMD java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar
22+
USER 1001
23+
24+
ENV CORE_ASYNC_POOL_SIZE=8
25+
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70"
26+
27+
CMD ["/usr/local/bin/kpow.sh"]

dockerfile/aws-mkt-pro/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
exec java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar

dockerfile/kpow-ce/Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ LABEL name="Kpow for Apache Kafka" \
1111
summary="Kpow is a toolkit for engineers who build, manage, and maintain systems powered by Apache Kafka." \
1212
description="Kpow features a rich data-oriented UI, specialized dashboards that deliver instant visibility into Kafka Clusters, Schema Registries, and Connect Installations, and developer tools that allow engineers to get to the heart of their systems quickly."
1313

14-
ADD --chmod=044 resources/eula.txt /licenses/eula.txt
15-
ADD --chmod=044 target/kpow-ce-standalone.jar /opt/factorhouse/lib/kpow.jar
14+
COPY resources/eula.txt /licenses/eula.txt
15+
COPY target/kpow-ce-standalone.jar /opt/factorhouse/lib/kpow.jar
16+
COPY entrypoint.sh /usr/local/bin/kpow.sh
1617

1718
RUN mkdir -p /opt/factorhouse/config/kpow
18-
ENV CORE_ASYNC_POOL_SIZE=8
19-
ENV CONFIG_DIR=/opt/factorhouse/config/kpow
20-
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70 --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED"
19+
RUN chown -R 1001:1001 /opt/factorhouse
2120

2221
EXPOSE 3000
2322

24-
CMD java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar
23+
USER 1001
24+
25+
ENV CORE_ASYNC_POOL_SIZE=8
26+
ENV CONFIG_DIR=/opt/factorhouse/config/kpow
27+
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70"
28+
29+
CMD ["/usr/local/bin/kpow.sh"]

dockerfile/kpow-ce/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
exec java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar

dockerfile/kpow/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ LABEL name="Kpow for Apache Kafka" \
1111
summary="Kpow is a toolkit for engineers who build, manage, and maintain systems powered by Apache Kafka." \
1212
description="Kpow features a rich data-oriented UI, specialized dashboards that deliver instant visibility into Kafka Clusters, Schema Registries, and Connect Installations, and developer tools that allow engineers to get to the heart of their systems quickly."
1313

14-
ADD --chmod=044 resources/eula.txt /licenses/eula.txt
15-
ADD --chmod=044 target/kpow-java17-standalone.jar /opt/factorhouse/lib/kpow.jar
14+
COPY resources/eula.txt /licenses/eula.txt
15+
COPY target/kpow-java17-standalone.jar /opt/factorhouse/lib/kpow.jar
16+
COPY entrypoint.sh /usr/local/bin/kpow.sh
1617

17-
ENV CORE_ASYNC_POOL_SIZE=8
18-
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70 --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED"
18+
RUN chown -R 1001:1001 /opt/factorhouse
1919

2020
EXPOSE 3000
2121

22-
CMD java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar
22+
USER 1001
23+
24+
ENV CORE_ASYNC_POOL_SIZE=8
25+
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70"
26+
27+
CMD ["/usr/local/bin/kpow.sh"]

dockerfile/kpow/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
exec java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar

dockerfile/rh-ubi/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ USER 0
1515

1616
ADD --chmod=044 resources/eula.txt /licenses/eula.txt
1717
ADD --chmod=044 target/kpow-java17-standalone.jar /opt/factorhouse/lib/kpow.jar
18+
ADD --chmod=044 entrypoint.sh /usr/local/bin/kpow.sh
19+
20+
RUN chown -R 1001:1001 /opt/factorhouse
1821

1922
EXPOSE 3000
2023
USER 1001
2124

2225
ENV CORE_ASYNC_POOL_SIZE=8
2326
ENV JVM_OPTS="-server -Dclojure.core.async.pool-size=$CORE_ASYNC_POOL_SIZE -XX:MaxInlineLevel=15 -Djava.awt.headless=true -XX:InitialRAMPercentage=70 -XX:MaxRAMPercentage=70"
24-
25-
CMD java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar
27+
CMD ["/usr/local/bin/kpow.sh"]

dockerfile/rh-ubi/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
exec java $JVM_OPTS -jar /opt/factorhouse/lib/kpow.jar

scripts/build_all.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ docker buildx build --pull \
1212
--build-arg RELEASE=$RELEASE \
1313
--build-arg VERSION=$VERSION \
1414
--platform=linux/amd64,linux/arm64 \
15+
--sbom=true \
16+
--provenance=true \
1517
-f $DOCKERFILE \
1618
-t $IMAGE_ID:$IMAGE_TAG \
17-
--push .
19+
--push .

scripts/build_amd64.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ docker buildx build --pull \
1212
--build-arg RELEASE=$RELEASE \
1313
--build-arg VERSION=$VERSION \
1414
--platform=linux/amd64 \
15+
--sbom=true \
16+
--provenance=true \
1517
-f $DOCKERFILE \
1618
-t $IMAGE_ID:$IMAGE_TAG \
17-
--push .
19+
--push .

0 commit comments

Comments
 (0)