-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move docker images to component directories
- Loading branch information
1 parent
f11457a
commit 329b805
Showing
15 changed files
with
149 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Build Stage | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build-env | ||
|
||
# We tell DNF not to install Recommends and Suggests packages, keeping our | ||
# installed set of packages as minimal as possible. | ||
RUN dnf --setopt=install_weak_deps=False install -q -y \ | ||
maven \ | ||
java-17-amazon-corretto-headless \ | ||
which \ | ||
&& \ | ||
dnf clean all | ||
|
||
ARG JAR_PATH | ||
|
||
VOLUME /tmp | ||
WORKDIR / | ||
|
||
COPY .mvn .mvn | ||
COPY mvnw . | ||
COPY pom.xml . | ||
|
||
RUN ./mvnw dependency:go-offline -B -q | ||
|
||
COPY ./src ./src | ||
|
||
RUN ./mvnw -DskipTests package -q && \ | ||
mv /target/carts-0.0.1-SNAPSHOT.jar /app.jar | ||
|
||
# Package Stage | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 | ||
|
||
# We tell DNF not to install Recommends and Suggests packages, which are | ||
# weak dependencies in DNF terminology, thus keeping our installed set of | ||
# packages as minimal as possible. | ||
RUN dnf --setopt=install_weak_deps=False install -q -y \ | ||
java-17-amazon-corretto-headless \ | ||
shadow-utils \ | ||
&& \ | ||
dnf clean all | ||
|
||
ARG aws_opentelemetry_agent_version=1.24.0 | ||
|
||
ENV APPUSER=appuser | ||
ENV APPUID=1000 | ||
ENV APPGID=1000 | ||
|
||
RUN useradd \ | ||
--home "/app" \ | ||
--create-home \ | ||
--user-group \ | ||
--uid "$APPUID" \ | ||
"$APPUSER" | ||
|
||
RUN curl -L https://github.com/aws-observability/aws-otel-java-instrumentation/releases/download/v${aws_opentelemetry_agent_version}/aws-opentelemetry-agent.jar -o /opt/aws-opentelemetry-agent.jar && \ | ||
curl -L https://raw.githubusercontent.com/aws-observability/aws-otel-java-instrumentation/v${aws_opentelemetry_agent_version}/licenses/licenses.md -o aws-opentelemetry-agent-licenses.md | ||
ENV JAVA_TOOL_OPTIONS=-javaagent:/opt/aws-opentelemetry-agent.jar | ||
ENV OTEL_JAVAAGENT_ENABLED=false | ||
|
||
WORKDIR /app | ||
USER appuser | ||
|
||
COPY ./ATTRIBUTION.md ./LICENSES.md | ||
COPY --chown=appuser:appuser --from=build-env /app.jar . | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
dockerfile='../../images/go/Dockerfile' | ||
pack_args='--env BP_KEEP_FILES=db/*' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Build Stage | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build-env | ||
|
||
# We tell DNF not to install Recommends and Suggests packages, keeping our | ||
# installed set of packages as minimal as possible. | ||
RUN dnf --setopt=install_weak_deps=False install -q -y \ | ||
maven \ | ||
java-17-amazon-corretto-headless \ | ||
which \ | ||
&& \ | ||
dnf clean all | ||
|
||
ARG JAR_PATH | ||
|
||
VOLUME /tmp | ||
WORKDIR / | ||
|
||
COPY .mvn .mvn | ||
COPY mvnw . | ||
COPY pom.xml . | ||
|
||
RUN ./mvnw dependency:go-offline -B -q | ||
|
||
COPY ./src ./src | ||
|
||
RUN ./mvnw -DskipTests package -q && \ | ||
mv /target/orders-0.0.1-SNAPSHOT.jar /app.jar | ||
|
||
# Package Stage | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 | ||
|
||
# We tell DNF not to install Recommends and Suggests packages, which are | ||
# weak dependencies in DNF terminology, thus keeping our installed set of | ||
# packages as minimal as possible. | ||
RUN dnf --setopt=install_weak_deps=False install -q -y \ | ||
java-17-amazon-corretto-headless \ | ||
shadow-utils \ | ||
&& \ | ||
dnf clean all | ||
|
||
ARG aws_opentelemetry_agent_version=1.24.0 | ||
|
||
ENV APPUSER=appuser | ||
ENV APPUID=1000 | ||
ENV APPGID=1000 | ||
|
||
RUN useradd \ | ||
--home "/app" \ | ||
--create-home \ | ||
--user-group \ | ||
--uid "$APPUID" \ | ||
"$APPUSER" | ||
|
||
RUN curl -L https://github.com/aws-observability/aws-otel-java-instrumentation/releases/download/v${aws_opentelemetry_agent_version}/aws-opentelemetry-agent.jar -o /opt/aws-opentelemetry-agent.jar && \ | ||
curl -L https://raw.githubusercontent.com/aws-observability/aws-otel-java-instrumentation/v${aws_opentelemetry_agent_version}/licenses/licenses.md -o aws-opentelemetry-agent-licenses.md | ||
ENV JAVA_TOOL_OPTIONS=-javaagent:/opt/aws-opentelemetry-agent.jar | ||
ENV OTEL_JAVAAGENT_ENABLED=false | ||
|
||
WORKDIR /app | ||
USER appuser | ||
|
||
COPY ./ATTRIBUTION.md ./LICENSES.md | ||
COPY --chown=appuser:appuser --from=build-env /app.jar . | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: MIT-0 | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this | ||
# software and associated documentation files (the "Software"), to deal in the Software | ||
# without restriction, including without limitation the rights to use, copy, modify, | ||
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
# permit persons to whom the Software is furnished to do so. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
version: '2' | ||
version: "2" | ||
|
||
services: | ||
ui: | ||
ports: | ||
- 8080 | ||
- 8080 | ||
environment: | ||
- JAVA_OPTS=-XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom | ||
- SERVER_TOMCAT_ACCESSLOG_ENABLED=true | ||
hostname: ui | ||
build: | ||
context: . | ||
dockerfile: ../../images/java17/Dockerfile | ||
args: | ||
JAR_PATH: target/ui-0.0.1-SNAPSHOT.jar | ||
image: microservices-demo/ui | ||
restart: always | ||
mem_limit: 256m | ||
cap_drop: | ||
- ALL | ||
- ALL |
This file was deleted.
Oops, something went wrong.