Skip to content

Commit e0434ec

Browse files
authored
Merge pull request #225 from georchestra/debug-mode-for-docker
Add shells to debug images
2 parents 71cfd89 + d81fb9c commit e0434ec

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737

3838
- name: "Build docker image"
3939
if: github.repository == 'georchestra/georchestra-gateway'
40-
run: make docker
40+
run: |
41+
make docker
42+
make docker-debug
4143
4244
- name: "Log in to docker.io"
4345
if: github.repository == 'georchestra/georchestra-gateway'
@@ -48,17 +50,16 @@ jobs:
4850

4951
- name: "Push latest to docker.io"
5052
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
51-
run: docker push georchestra/gateway:latest
53+
run: |
54+
docker push georchestra/gateway:latest
55+
docker push georchestra/gateway:latest-debug
5256
5357
- name: "Pushing release branch to docker.io"
54-
if: endsWith(github.ref, '.x') && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
58+
if: (endsWith(github.ref, '.x') || github.ref_type == 'tag') && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
5559
run: |
5660
docker tag georchestra/gateway:latest georchestra/gateway:${{ steps.version.outputs.VERSION }}
5761
docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
58-
59-
- name: "Push tagged image to docker.io"
60-
if: github.ref_type == 'tag' && github.ref != 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
61-
run: docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
62+
docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}-debug
6263
6364
- name: "Update Gateway Docker Hub Description"
6465
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'

DOCKER_HUB.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Featured tags
1010

1111
- `latest`, `2.0.x`, `1.1.2`
12+
- `latest-debug`, `2.0.x-debug`. It enables shell inside the container for debugging purposes.
1213

1314
# Quick reference
1415

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ docker:
1313
docker tag georchestra/gateway:$${TAG} georchestra/gateway:latest && \
1414
docker images|grep "georchestra/gateway"|grep latest
1515

16+
docker-debug:
17+
@TAG=`./mvnw -f gateway/ help:evaluate -q -DforceStdout -Dexpression=imageTag` && \
18+
./mvnw package -f gateway/ -Pdocker-debug -ntp -DskipTests && \
19+
docker tag georchestra/gateway:$${TAG} georchestra/gateway:latest-debug
20+
1621
deb: install
1722
./mvnw package deb:package -f gateway/ -PdebianPackage

gateway/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,33 @@
252252
</plugins>
253253
</build>
254254
</profile>
255+
<profile>
256+
<id>docker-debug</id>
257+
<build>
258+
<plugins>
259+
<plugin>
260+
<groupId>org.springframework.boot</groupId>
261+
<artifactId>spring-boot-maven-plugin</artifactId>
262+
<executions>
263+
<execution>
264+
<id>build-image</id>
265+
<goals>
266+
<goal>build-image</goal>
267+
</goals>
268+
</execution>
269+
</executions>
270+
<configuration>
271+
<image>
272+
<builder>paketobuildpacks/builder-jammy-base</builder>
273+
<name>georchestra/${project.artifactId}:${project.version}-debug</name>
274+
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
275+
</image>
276+
<jvmOptions>-XX:MaxRAMPercentage=80 -XX:+UseParallelGC</jvmOptions>
277+
</configuration>
278+
</plugin>
279+
</plugins>
280+
</build>
281+
</profile>
255282
<profile>
256283
<id>debianPackage</id>
257284
<build>

0 commit comments

Comments
 (0)