Skip to content

Commit

Permalink
Merge pull request #19
Browse files Browse the repository at this point in the history
ci: linux/amd64 build
  • Loading branch information
cybersokari authored Jun 16, 2024
2 parents b259aac + e04ac10 commit bf525c5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
cp ${{ env.GOOGLE_APPLICATION_CREDENTIALS }} cred.json
- name: Build Image
run: docker build -t web -f ${{vars.DOCKER_FILE_NAME}} . --build-arg PROJECT_ID=${{vars.PROJECT_ID}}
run: |
docker build -t web -f ${{vars.DOCKER_FILE_NAME}} . \
--build-arg PROJECT_ID=${{vars.PROJECT_ID}} --platform linux/amd64
- name: Configure Docker for Artifact Registry
run: gcloud auth configure-docker ${{vars.DOCKER_CRED_HELPER}} -q
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/gcp/cred.json
- GCLOUD_PROJECT=gatedaccessdev
mem_limit: 512m
cpus: 1
native:
image: native
ports:
Expand All @@ -17,4 +19,6 @@ services:
- $HOME/.config/gcloud/application_default_credentials.json:/gcp/cred.json
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/gcp/cred.json
- GCLOUD_PROJECT=gatedaccessdev
- GCLOUD_PROJECT=gatedaccessdev
mem_limit: 512m
cpus: 1
2 changes: 1 addition & 1 deletion jvm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN ./mvnw dependency:go-offline -DskipTests
RUN ./mvnw package -DskipTests

# Stage 2: Create the final Docker image
FROM bellsoft/liberica-openjre-alpine as final
FROM --platform=$TARGETPLATFORM bellsoft/liberica-openjre-alpine as final
# Copy the application from the build stage
COPY --from=build /app/target/web-0.0.1-SNAPSHOT.jar .
# Command to run the application
Expand Down
4 changes: 2 additions & 2 deletions native.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build GraalVM native image
FROM ghcr.io/graalvm/graalvm-ce:latest as build
FROM --platform=$BUILDPLATFORM ghcr.io/graalvm/graalvm-ce:latest as build
# GOOGLE_APPLICATION_CREDENTIALS and GCLOUD_PROJECT
# environment variables are required for a successful
# AOT compilation process, which starts the app
Expand Down Expand Up @@ -27,7 +27,7 @@ RUN ./mvnw dependency:go-offline -DskipTests
RUN ./mvnw package -Pnative -DskipTests

# Stage 2: Create the final Docker image
FROM alpine:latest AS final
FROM --platform=$TARGETPLATFORM alpine:latest AS final
# Set the working directory
WORKDIR /app
# Installs the libc6-compat package, which provides
Expand Down
40 changes: 20 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,25 @@
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
<!-- Jacoco plugin -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.jacoco</groupId>-->
<!-- <artifactId>jacoco-maven-plugin</artifactId>-->
<!-- <version>0.8.12</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>prepare-agent</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- <execution>-->
<!-- <id>report</id>-->
<!-- <phase>prepare-package</phase>-->
<!-- <goals>-->
<!-- <goal>report</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- Surefire plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -277,7 +277,7 @@
<artifactId>native-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<skipNativeTests>true</skipNativeTests>
<skipNativeTests>false</skipNativeTests>
<buildArgs>
<arg>--initialize-at-build-time=org.slf4j.helpers</arg>
<!-- 3. Quick build mode -->
Expand Down

0 comments on commit bf525c5

Please sign in to comment.