Migrate base images to Temurin and add images for ARM (#97)

This commit is contained in:
kezhenxu94 2022-01-26 16:09:44 +08:00 committed by GitHub
parent b7bb3f818b
commit 75cc77de10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 39 deletions

View File

@ -60,7 +60,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
java-version: [ 8, 11, 12, 13, 14, 15, 16, 17 ]
java-version: [ 8, 11, 17 ]
env:
TAG: ${{ github.sha }}
steps:

View File

@ -22,6 +22,7 @@ Release Notes.
* Follow protocol grammar fix `GCPhrase -> GCPhase`.
* Support ZGC GC time and count metric collect. (Require 9.0.0 OAP)
* Support configuration for collecting redis parameters for jedis-2.x and redisson-3.x plugin.
* Migrate base images to Temurin and add images for ARM.
#### Documentation

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARG BASE_IMAGE='adoptopenjdk/openjdk8:alpine-jre'
ARG BASE_IMAGE='eclipse-temurin:8-jre'
ARG SKYWALKING_CLI_VERSION
@ -24,7 +24,7 @@ FROM $BASE_IMAGE
ARG DIST=skywalking-agent
RUN apk add --no-cache openssl
RUN apk add --no-cache openssl || true
LABEL maintainer="kezhenxu94@apache.org"

View File

@ -34,35 +34,34 @@ dist: build
# Docker build
base.adopt := java8 java11 java12 java13 java14 java15 java16
base.temurin := java17
base.all := alpine $(base.adopt) $(base.temurin)
base.all := alpine java8 java11 java17
base.each = $(word 1, $@)
base.image.alpine := alpine:3
base.image.java8 := adoptopenjdk/openjdk8:alpine-jre
base.image.java11 := adoptopenjdk/openjdk11:alpine-jre
base.image.java12 := adoptopenjdk/openjdk12:alpine-jre
base.image.java13 := adoptopenjdk/openjdk13:alpine-jre
base.image.java14 := adoptopenjdk/openjdk14:alpine-jre
base.image.java15 := adoptopenjdk/openjdk15:alpine-jre
base.image.java16 := adoptopenjdk/openjdk16:alpine-jre
base.image.java17 := eclipse-temurin:17-alpine
base.image.java8 := eclipse-temurin:8-jre
base.image.java11 := eclipse-temurin:11-jre
base.image.java17 := eclipse-temurin:17-jre
docker.%: PLATFORMS =
docker.%: LOAD_OR_PUSH = --load
docker.push.%: PLATFORMS = --platform linux/amd64,linux/arm64
docker.push.%: LOAD_OR_PUSH = --push
.PHONY: $(base.all)
$(base.all:%=docker.%): BASE_IMAGE=$($(base.each:docker.%=base.image.%))
$(base.all:%=docker.%): docker.%: skywalking-agent
docker build --no-cache --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg DIST=$(AGENT_PACKAGE) --build-arg SKYWALKING_CLI_VERSION=$(CLI_VERSION) . -t $(HUB)/$(NAME):$(TAG)-$(base.each:docker.%=%)
$(base.all:%=docker.%): FINAL_TAG=$(TAG)-$(base.each:docker.%=%)
$(base.all:%=docker.push.%): BASE_IMAGE=$($(base.each:docker.push.%=base.image.%))
$(base.all:%=docker.push.%): FINAL_TAG=$(TAG)-$(base.each:docker.push.%=%)
$(base.all:%=docker.%) $(base.all:%=docker.push.%): skywalking-agent
docker buildx create --use --driver docker-container --name skywalking_main > /dev/null 2>&1 || true
docker buildx build $(PLATFORMS) $(LOAD_OR_PUSH) \
--no-cache \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg DIST=$(AGENT_PACKAGE) \
--build-arg SKYWALKING_CLI_VERSION=$(CLI_VERSION) \
. -t $(HUB)/$(NAME):$(FINAL_TAG)
docker buildx rm skywalking_main || true
.PHONY: docker
.PHONY: docker docker.push
docker: $(base.all:%=docker.%)
# Docker push
.PHONY: $(base.all:%=docker.push.%)
$(base.all:%=docker.push.%): docker.push.%: docker.%
docker push $(HUB)/$(NAME):$(TAG)-$(base.each:docker.push.%=%)
.PHONY: docker.push
docker.push: $(base.all:%=docker.%)
docker.push: $(base.all:%=docker.push.%)

View File

@ -24,7 +24,7 @@ folders if you are using IntelliJ IDE.
# Building Docker images
After you have [compiled the project](#compiling-project) and have generated the `skywalking-agent` folder, you can
build Docker images. [`make docker`] builds the agent Docker images based on `alpine` image and `java8 ~ java 17`
build Docker images. [`make docker`] builds the agent Docker images based on `alpine` image, `java8`, `java11` and `java 17`
images by default. If you want to only build part of the images, add suffix `.alpine` or `.java<x>` to the `make`
target, for example:

View File

@ -49,7 +49,7 @@ services:
JAVA_TOOL_OPTIONS: -javaagent:/skywalking/agent/skywalking-agent.jar=agent.instance_properties[org]=apache
SW_INSTANCE_PROPERTIES_JSON: "{\"org\": \"apache-skywalking\"}"
healthcheck:
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9090" ]
interval: 5s
timeout: 60s
retries: 120
@ -70,7 +70,7 @@ services:
SW_AGENT_INSTANCE_NAME: consumer1
SW_LOGGING_OUTPUT: CONSOLE
healthcheck:
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9090"]
interval: 5s
timeout: 60s
retries: 120

View File

@ -17,11 +17,11 @@ FROM skywalking/skywalking-java:latest-java8
ARG ENABLE_KAFKA_REPORTER
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
RUN if [ "${ENABLE_KAFKA_REPORTER}" = "true" ]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
VOLUME /services
ADD target/e2e-service-consumer.jar /services/
ENV JAVA_OPTS=""
CMD ["sh", "-c", "java $JAVA_OPTS -jar /services/e2e-service-consumer.jar"]
CMD ["bash", "-c", "java $JAVA_OPTS -jar /services/e2e-service-consumer.jar"]

View File

@ -17,11 +17,11 @@ FROM skywalking/skywalking-java:latest-java8
ARG ENABLE_KAFKA_REPORTER
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
RUN if [ "${ENABLE_KAFKA_REPORTER}" = "true" ]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
VOLUME /services
ADD target/e2e-service-provider.jar /services/
ENV JAVA_OPTS=""
CMD ["sh", "-c", "java $JAVA_OPTS -jar /services/e2e-service-provider.jar"]
CMD ["bash", "-c", "java $JAVA_OPTS -jar /services/e2e-service-provider.jar"]

View File

@ -18,7 +18,7 @@
setup:
env: compose
file: docker-compose.yml
timeout: 1200
timeout: 20m
init-system-environment: ../../script/env
steps:
- name: install yq
@ -26,10 +26,6 @@ setup:
- name: install swctl
command: bash test/e2e/script/prepare/install.sh swctl
cleanup:
# always never success failure
on: always
trigger:
action: http
interval: 3s