forked from arjungautam1/fullstack-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container-structure-test.yaml
56 lines (53 loc) · 1.69 KB
/
container-structure-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
# Run command:
# > container-structure-test test --image demoapp-backend --config container-structure-test.yaml
schemaVersion: 2.0.0
metadataTest:
envVars:
- key: JAVA_HOME
value: /usr/lib/jvm/jre
# Confirm Base Image Name
- key: JBOSS_IMAGE_NAME
value: ubi8/openjdk-17-runtime # Confirm runtime image was used as base image instead of build image
# Confirm Java Version, must match with `project.properties["java.version"] in pom.xml`
- key: JAVA_VERSION
value: "17"
# Confirm Java Vendor
- key: JAVA_VENDOR
value: openjdk
# Confirm Image OCI compliance
- key: container
value: oci
labels:
# Confirm labels from Red Hat provided base image
- key: name
value: ubi8/openjdk-17-runtime # Confirm runtime image was used as base image instead of build image
- key: vendor
value: Red Hat, Inc.
- key: version
value: "1.17"
exposedPorts: ["8080"]
volumes: []
entrypoint: []
cmd: ["/usr/bin/java", "-jar", "/app/demoapp-backend.jar"]
workdir: /app
user: 185
commandTests:
- name: Confirm Java Version 17
command: java
args: ['-version']
expectedError: ['.* version "17.*'] # Version output is sent to stderr
fileExistenceTests:
- name: Confirm absence of application source files
path: /home/jboss/src
shouldExist: false
- name: Confirm absence of application pom.xml
path: /home/jboss/pom.xml
shouldExist: false
- name: Confirm existence of application JAR
path: /app/demoapp-backend.jar
shouldExist: true
permissions: -rw-r--r--
# UID and GID values are from based image: registry.access.redhat.com/ubi8/openjdk-17-runtime
uid: 185
gid: 0