-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sérgio Martins
authored
Mar 20, 2021
1 parent
ed73680
commit 0ce916c
Showing
5 changed files
with
77 additions
and
0 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,5 @@ | ||
## Docker images | ||
|
||
Here you find useful and lightweight Dockerfiles. | ||
|
||
Furthermore, there is also a `release-example.sh` file that will guide you through on how to release your Docker image to any desired registry. |
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,17 @@ | ||
FROM alpine:3.11 | ||
|
||
ENV JAVA_VERSION="11.0.5_p10-r0" | ||
ENV MAVEN_VERSION="3.6.3-r0" | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk | ||
ENV PATH $PATH:/usr/lib/jvm/java-11-openjdk/jre/bin:/usr/lib/jvm/java-11-openjdk/bin | ||
|
||
RUN set -x \ | ||
&& apk update \ | ||
&& apk add --no-cache \ | ||
openjdk11="${JAVA_VERSION}" \ | ||
maven \ | ||
&& rm -rf /var/cache/* \ | ||
&& rm -rf /root/.cache/* | ||
|
||
CMD ["/bin/sh"] |
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,15 @@ | ||
FROM alpine:3.11 | ||
|
||
ENV JAVA_VERSION="11.0.5_p10-r0" | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk | ||
ENV PATH $PATH:/usr/lib/jvm/java-11-openjdk/jre/bin:/usr/lib/jvm/java-11-openjdk/bin | ||
|
||
RUN set -x \ | ||
&& apk update \ | ||
&& apk add --no-cache \ | ||
openjdk11="${JAVA_VERSION}" \ | ||
&& rm -rf /var/cache/* \ | ||
&& rm -rf /root/.cache/* | ||
|
||
CMD ["/bin/sh"] |
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,11 @@ | ||
FROM alpine:3.11 | ||
|
||
RUN set -x \ | ||
&& apk update \ | ||
&& apk add --no-cache \ | ||
python3 \ | ||
&& pip3 install --no-cache-dir --upgrade pip \ | ||
&& rm -rf /var/cache/* \ | ||
&& rm -rf /root/.cache/* | ||
|
||
CMD ["/bin/sh"] |
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,29 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
DOCKERFILE=jdk11.Dockerfile | ||
DOCKER_REGISTRY=docker.io | ||
DOCKER_IMAGE=${DOCKER_REGISTRY}/<your-docker-hub-user-name>/<your-image-name> | ||
DOCKER_TAG=1.0.0 | ||
|
||
## LOGIN | ||
echo 'Logging into docker hub' | ||
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin | ||
|
||
## BUILD IMAGE | ||
echo 'Building docker image' | ||
docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} -f ${DOCKERFILE} . | ||
|
||
## TAG IMAGE | ||
echo 'Tagging image' | ||
docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest | ||
|
||
## UPLOAD IMAGE | ||
echo 'Uploading image' | ||
docker push ${DOCKER_IMAGE}:${DOCKER_TAG} | ||
docker push ${DOCKER_IMAGE}:latest | ||
|
||
## CLEAR WORKSPACE | ||
echo 'Clearing workspace' | ||
docker rmi ${DOCKER_IMAGE}:${DOCKER_TAG} | ||
docker rmi ${DOCKER_IMAGE}:latest |