Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,34 @@ WITHTOOLS_IMAGE_NAME=codacy/withtools

VERSION?=$(shell cat .version || echo dev)
OPENJ9_VERSION?=openj9-$(VERSION)
OPENJDK11_VERSION?=jre11-$(VERSION)
OPENJDK17_VERSION?=jre17-$(VERSION)
BASE_IMAGE_OPENJDK=adoptopenjdk/openjdk8:x86_64-ubuntu-jre8u462-b08
BASE_IMAGE_OPENJDK11=eclipse-temurin:11-jdk-focal
Comment thread
zhamborova marked this conversation as resolved.
Outdated
BASE_IMAGE_OPENJDK17=eclipse-temurin:17.0.16_8-jre-jammy
BASE_IMAGE_OPENJ9=adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jre8u462-b08_openj9-0.53.0

all: docker_build ## produce the docker image

docker_build: ## build the docker image
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(BASE_IMAGE_NAME):$(VERSION) --target base .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJ9) --no-cache -t $(BASE_IMAGE_NAME):$(OPENJ9_VERSION) --target base .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(BASE_IMAGE_NAME):$(VERSION) --target base .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid the alignment

docker build --build-arg base_image=$(BASE_IMAGE_OPENJ9) --no-cache -t $(BASE_IMAGE_NAME):$(OPENJ9_VERSION) --target base .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK11) --no-cache -t $(BASE_IMAGE_NAME):$(OPENJDK11_VERSION) --target base .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK17) --no-cache -t $(BASE_IMAGE_NAME):$(OPENJDK17_VERSION) --target base .

docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(VERSION) --target withtools .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJ9) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(OPENJ9_VERSION) --target withtools .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(VERSION) --target withtools .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Suggested change
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(VERSION) --target withtools .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(VERSION) --target withtools .

docker build --build-arg base_image=$(BASE_IMAGE_OPENJ9) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(OPENJ9_VERSION) --target withtools .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK11) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(OPENJDK11_VERSION) --target withtools .
docker build --build-arg base_image=$(BASE_IMAGE_OPENJDK17) --no-cache -t $(WITHTOOLS_IMAGE_NAME):$(OPENJDK17_VERSION) --target withtools .


docker_scan: ## scan docker images using Docker Scout
docker scout quickview $(BASE_IMAGE_NAME):$(VERSION) || true
docker scout quickview $(BASE_IMAGE_NAME):$(OPENJ9_VERSION) || true
docker scout quickview $(BASE_IMAGE_NAME):$(OPENJDK11_VERSION) || true
docker scout quickview $(BASE_IMAGE_NAME):$(OPENJDK17_VERSION) || true
docker scout quickview $(WITHTOOLS_IMAGE_NAME):$(VERSION) || true
docker scout quickview $(WITHTOOLS_IMAGE_NAME):$(OPENJ9_VERSION) || true
docker scout quickview $(WITHTOOLS_IMAGE_NAME):$(OPENJDK11_VERSION) || true
docker scout quickview $(WITHTOOLS_IMAGE_NAME):$(OPENJDK17_VERSION) || true


Expand All @@ -34,9 +39,11 @@ push-docker-image: ## push the docker image to the registry (DOCKER_USER and DOC
@docker login -u $(DOCKER_USER) -p $(DOCKER_PASS) &&\
Comment thread
zhamborova marked this conversation as resolved.
docker push $(BASE_IMAGE_NAME):$(VERSION)
docker push $(BASE_IMAGE_NAME):$(OPENJ9_VERSION)
docker push $(BASE_IMAGE_NAME):$(OPENJDK11_VERSION)
docker push $(BASE_IMAGE_NAME):$(OPENJDK17_VERSION)
docker push $(WITHTOOLS_IMAGE_NAME):$(VERSION)
docker push $(WITHTOOLS_IMAGE_NAME):$(OPENJ9_VERSION)
docker push $(WITHTOOLS_IMAGE_NAME):$(OPENJDK11_VERSION)
docker push $(WITHTOOLS_IMAGE_NAME):$(OPENJDK17_VERSION)

.PHONY: push-latest-docker-image
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

Dockerfile describing a docker containing:
- Debian Buster
Comment thread
zhamborova marked this conversation as resolved.
Outdated
- OpenJDK 8 JRE
- Available Java versions:
- OpenJDK 8 JRE (default)
- OpenJDK 8 JRE with OpenJ9
- OpenJDK 11 JRE
- OpenJDK 17 JRE
- Docker cli 17.09.*
- Git cli 2.*
- Unix tools: curl, wget and unzip.
Expand Down