Skip to content

Commit cb7954a

Browse files
authored
Merge pull request #3 from barnhill/update-springboot-multi-platform-images
Update Springboot / multi platform images
2 parents fd065c4 + 0528e99 commit cb7954a

File tree

18 files changed

+254
-106
lines changed

18 files changed

+254
-106
lines changed

.github/workflows/docker-image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-java@v3
18+
with:
19+
distribution: 'zulu' # See 'Supported distributions' for available options
20+
java-version: '17'
21+
- uses: docker/setup-buildx-action@v2
1722
- name: Login to Docker
1823
run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
1924
env:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM arm64v8/openjdk:slim
1+
FROM amazoncorretto:17
22
MAINTAINER bradfordbarnhill@gmail.com
33

44
ADD build/libs/barcode-api.jar /

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
wrapper {
22
//if you change this version you will need to run the 'gradlew wrapper' command twice from the command line to auto update the gradle cache
3-
gradleVersion = "7.5.1"
3+
gradleVersion = "8.0.1"
44
}
55
buildscript {
66
repositories {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.3")
10+
classpath("org.springframework.boot:spring-boot-gradle-plugin:3.0.2")
1111
}
1212
}
1313

@@ -20,15 +20,15 @@ apply plugin: 'war'
2020

2121
group = 'com.pnuema.java.barcode'
2222
version '1.13'
23-
sourceCompatibility = 11
24-
targetCompatibility = 11
23+
sourceCompatibility = 17
24+
targetCompatibility = 17
2525

2626
bootJar {
27-
archiveName = 'barcode-api.jar'
27+
archiveFileName = 'barcode-api.jar'
2828
}
2929

3030
war {
31-
archiveName = 'barcode-api.war'
31+
archiveFileName = 'barcode-api.war'
3232
}
3333

3434
repositories {
@@ -48,7 +48,7 @@ dependencies {
4848
implementation 'com.pnuema.java:barcode:1.13'
4949
implementation 'org.springframework.boot:spring-boot-starter-web'
5050
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
51-
implementation 'org.springdoc:springdoc-openapi-ui:1.6.11'
51+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
5252
testImplementation 'org.springframework.boot:spring-boot-starter-test'
5353
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
5454
}

docker-compose.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
services:
2-
linux:
2+
linux-arm64:
33
platform: linux/arm64
44
# Linux Container
55
build:
66
context: .
7-
dockerfile: ./Dockerfile
7+
dockerfile: Dockerfile
88
ports:
99
- "8080:8080"
1010
expose:
1111
- 8080
12-
image: bradbarnhill/barcode-api
12+
image: bradbarnhill/barcode-api:arm64
13+
linux-amd64:
14+
platform: linux/amd64
15+
# Linux Container
16+
build:
17+
context: .
18+
dockerfile: Dockerfile
19+
ports:
20+
- "8080:8080"
21+
expose:
22+
- 8080
23+
image: bradbarnhill/barcode-api:amd64

dockerbuild.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./gradlew clean bootJar & docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag bradbarnhill/barcode-api:latest .

dockerbuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
./gradlew clean bootJar
2-
docker-compose build linux
3-
docker-compose push linux
2+
3+
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag bradbarnhill/barcode-api:latest .

dockerrun.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run --rm -p 8080:8080 bradbarnhill/barcode-api
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

local.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Location of the SDK. This is only used by Gradle.
55
# For customization when using a Version Control System, please read the
66
# header note.
7-
#Mon Jan 03 21:01:30 CST 2022
8-
sdk.dir=C\:\\Users\\bradb\\AppData\\Local\\Android\\Sdk
7+
#Sun Feb 26 21:24:08 CST 2023
8+
sdk.dir=/Users/b359923/Library/Android/sdk

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
<developerConnection>https://github.com/barnhill/barcode-java.git</developerConnection>
2828
<url>https://github.com/barnhill/barcode-java</url>
2929
</scm>
30+
<properties>
31+
<maven.compiler.source>17</maven.compiler.source>
32+
<maven.compiler.target>17</maven.compiler.target>
33+
</properties>
3034
<dependencies>
3135
<dependency>
3236
<groupId>org.springframework.boot</groupId>
@@ -55,5 +59,15 @@
5559
<artifactId>spring-boot-starter-test</artifactId>
5660
<scope>test</scope>
5761
</dependency>
62+
<dependency>
63+
<groupId>org.apache.tomcat.embed</groupId>
64+
<artifactId>tomcat-embed-core</artifactId>
65+
<version>9.0.52</version>
66+
</dependency>
67+
<dependency>
68+
<groupId>io.swagger.core.v3</groupId>
69+
<artifactId>swagger-annotations</artifactId>
70+
<version>2.1.2</version>
71+
</dependency>
5872
</dependencies>
5973
</project>

0 commit comments

Comments
 (0)