Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Update port from 8081 to 8080 #33

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Creating an application with a Spring Boot code sample

**Note:** The Spring Boot code sample uses the **8081** HTTP port.
**Note:** The Spring Boot code sample version uses the **8080** HTTP port.

Before you begin creating an application with this `devfile` code sample, it's helpful to understand the relationship between the `devfile` and `Dockerfile` and how they contribute to your build. You can find these files at the following URLs:

Expand Down
8 changes: 4 additions & 4 deletions deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
image: java-springboot-image:latest
ports:
- name: http
containerPort: 8081
containerPort: 8080
protocol: TCP
resources:
requests:
Expand All @@ -30,9 +30,9 @@ metadata:
name: my-java-springboot-svc
spec:
ports:
- name: http-8081
port: 8081
- name: http-8080
port: 8080
protocol: TCP
targetPort: 8081
targetPort: 8080
selector:
app: java-springboot-app
8 changes: 4 additions & 4 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schemaVersion: 2.2.0
metadata:
name: java-springboot
version: 1.2.1
version: 2.0.0
attributes:
alpha.dockerimage-port: 8081
displayName: Spring Boot®
Expand Down Expand Up @@ -30,12 +30,12 @@ components:
deployment/replicas: 1
deployment/cpuRequest: 10m
deployment/memoryRequest: 180Mi
deployment/container-port: 8081
deployment/container-port: 8080
kubernetes:
uri: deploy.yaml
endpoints:
- name: http-8081
targetPort: 8081
- name: http-8080
targetPort: 8080
path: /
commands:
- id: build-image
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Then run the container using:
#
# docker run -i --rm -p 8081:8081 springboot/sample-demo
# docker run -i --rm -p 8080:8080 springboot/sample-demo
####
FROM registry.access.redhat.com/ubi8/openjdk-17:1.15-1.1682053058 AS builder

Expand All @@ -26,7 +26,7 @@ RUN grep artifactId target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-
RUN mv target/$(cat .env-id)-$(cat .env-version).jar target/export-run-artifact.jar

FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15-1.1682053056
COPY --from=builder /home/jboss/project/target/export-run-artifact.jar /deployments/export-run-artifact.jar
EXPOSE 8081
ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh", "--server.port=8081"]

COPY --from=builder /home/jboss/target/export-run-artifact.jar /deployments/export-run-artifact.jar
EXPOSE 8080
ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh", "--server.port=8080"]