Skip to content

Commit

Permalink
Merge pull request #2 from takara9/test_commit
Browse files Browse the repository at this point in the history
Test commit
  • Loading branch information
takara9 authored May 25, 2024
2 parents cfc8b69 + e98864b commit 3cfa6e0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Check Dockerfile
run: |
Expand All @@ -33,7 +40,6 @@ jobs:
context: .
push: false
tags: ${{ env.IMAGE_NAME }}
#platforms: linux/amd64,linux/arm64
labels: ${{ env.IMAGE_NAME }}

- name: Check vulnerabilities
Expand All @@ -49,8 +55,8 @@ jobs:
- name: Test the container
run: |
sleep 5
curl --silent --retry 3 --include http://127.0.0.1:9500/ping | grep "200 OK"
sleep 10
curl --silent --retry 3 --include http://127.0.0.1:9500/ping | grep "HTTP/1.1 200"
[ $? -ne 0 ] && (echo "error"; exit 1)
exit 0
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM eclipse-temurin:latest
FROM eclipse-temurin:21.0.3_9-jre

# アプリケーションのインストール
RUN mkdir /app
WORKDIR /app
COPY --chown=65534:65534 target/rest-service-0.0.1.jar /app/rest-service.jar
COPY --chown=65534:65534 target/rest-service-1.0.0.jar /app/rest-service.jar

# コンテナの設定
USER 65534:65534
EXPOSE 8080
CMD ["java", "-jar", "/app/rest-service.jar"]

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Javaで作るコンテナイメージ

## ディレクトリ構造

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</parent>
<groupId>com.example</groupId>
<artifactId>rest-service</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<name>rest-service</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
Expand Down

0 comments on commit 3cfa6e0

Please sign in to comment.