-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround issue with mn gradle plugin when setting docker base image
- Loading branch information
1 parent
0cc97be
commit 87f6f92
Showing
4 changed files
with
35 additions
and
4 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
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,10 @@ | ||
FROM amazoncorretto:17-alpine3.18 | ||
|
||
COPY build/libs/ses-notification-lambda-test-all.jar /home/not-root/application.jar | ||
|
||
# Configure non-root user | ||
RUN addgroup -g 3000 not-root \ | ||
&& adduser -u 1000 -s /bin/false -D -G not-root not-root | ||
USER not-root | ||
|
||
ENTRYPOINT ["java", "-jar", "/home/not-root/application.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /usr/bin/env sh | ||
|
||
############################################################################### | ||
# This script is used in place of `./gradlew dockerPush` because of an issue | ||
# that prevents us from selecting the base container issue we want to use. | ||
# | ||
# https://github.com/micronaut-projects/micronaut-gradle-plugin/issues/820 | ||
############################################################################### | ||
|
||
if [ -z "${DOCKER_IMAGE}" ]; then | ||
echo "Need a container image in env var DOCKER_IMAGE" && exit 1 | ||
fi | ||
|
||
./gradlew assemble | ||
docker build . -f scripts/Dockerfile -t "${DOCKER_IMAGE}" | ||
docker push "${DOCKER_IMAGE}" |
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