Skip to content

Commit 75cc77d

Browse files
authored
Migrate base images to Temurin and add images for ARM (#97)
1 parent b7bb3f8 commit 75cc77d

File tree

9 files changed

+35
-39
lines changed

9 files changed

+35
-39
lines changed

Diff for: .github/workflows/publish-docker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
timeout-minutes: 60
6161
strategy:
6262
matrix:
63-
java-version: [ 8, 11, 12, 13, 14, 15, 16, 17 ]
63+
java-version: [ 8, 11, 17 ]
6464
env:
6565
TAG: ${{ github.sha }}
6666
steps:

Diff for: CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Release Notes.
2222
* Follow protocol grammar fix `GCPhrase -> GCPhase`.
2323
* Support ZGC GC time and count metric collect. (Require 9.0.0 OAP)
2424
* Support configuration for collecting redis parameters for jedis-2.x and redisson-3.x plugin.
25+
* Migrate base images to Temurin and add images for ARM.
2526

2627
#### Documentation
2728

Diff for: Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
ARG BASE_IMAGE='adoptopenjdk/openjdk8:alpine-jre'
17+
ARG BASE_IMAGE='eclipse-temurin:8-jre'
1818

1919
ARG SKYWALKING_CLI_VERSION
2020

@@ -24,7 +24,7 @@ FROM $BASE_IMAGE
2424

2525
ARG DIST=skywalking-agent
2626

27-
RUN apk add --no-cache openssl
27+
RUN apk add --no-cache openssl || true
2828

2929
LABEL maintainer="[email protected]"
3030

Diff for: Makefile

+23-24
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,34 @@ dist: build
3434

3535
# Docker build
3636

37-
base.adopt := java8 java11 java12 java13 java14 java15 java16
38-
base.temurin := java17
39-
40-
base.all := alpine $(base.adopt) $(base.temurin)
37+
base.all := alpine java8 java11 java17
4138
base.each = $(word 1, $@)
4239

4340
base.image.alpine := alpine:3
44-
base.image.java8 := adoptopenjdk/openjdk8:alpine-jre
45-
base.image.java11 := adoptopenjdk/openjdk11:alpine-jre
46-
base.image.java12 := adoptopenjdk/openjdk12:alpine-jre
47-
base.image.java13 := adoptopenjdk/openjdk13:alpine-jre
48-
base.image.java14 := adoptopenjdk/openjdk14:alpine-jre
49-
base.image.java15 := adoptopenjdk/openjdk15:alpine-jre
50-
base.image.java16 := adoptopenjdk/openjdk16:alpine-jre
51-
base.image.java17 := eclipse-temurin:17-alpine
41+
base.image.java8 := eclipse-temurin:8-jre
42+
base.image.java11 := eclipse-temurin:11-jre
43+
base.image.java17 := eclipse-temurin:17-jre
44+
45+
docker.%: PLATFORMS =
46+
docker.%: LOAD_OR_PUSH = --load
47+
docker.push.%: PLATFORMS = --platform linux/amd64,linux/arm64
48+
docker.push.%: LOAD_OR_PUSH = --push
5249

5350
.PHONY: $(base.all)
5451
$(base.all:%=docker.%): BASE_IMAGE=$($(base.each:docker.%=base.image.%))
55-
$(base.all:%=docker.%): docker.%: skywalking-agent
56-
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.%=%)
52+
$(base.all:%=docker.%): FINAL_TAG=$(TAG)-$(base.each:docker.%=%)
53+
$(base.all:%=docker.push.%): BASE_IMAGE=$($(base.each:docker.push.%=base.image.%))
54+
$(base.all:%=docker.push.%): FINAL_TAG=$(TAG)-$(base.each:docker.push.%=%)
55+
$(base.all:%=docker.%) $(base.all:%=docker.push.%): skywalking-agent
56+
docker buildx create --use --driver docker-container --name skywalking_main > /dev/null 2>&1 || true
57+
docker buildx build $(PLATFORMS) $(LOAD_OR_PUSH) \
58+
--no-cache \
59+
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
60+
--build-arg DIST=$(AGENT_PACKAGE) \
61+
--build-arg SKYWALKING_CLI_VERSION=$(CLI_VERSION) \
62+
. -t $(HUB)/$(NAME):$(FINAL_TAG)
63+
docker buildx rm skywalking_main || true
5764

58-
.PHONY: docker
65+
.PHONY: docker docker.push
5966
docker: $(base.all:%=docker.%)
60-
61-
# Docker push
62-
63-
.PHONY: $(base.all:%=docker.push.%)
64-
$(base.all:%=docker.push.%): docker.push.%: docker.%
65-
docker push $(HUB)/$(NAME):$(TAG)-$(base.each:docker.push.%=%)
66-
67-
.PHONY: docker.push
68-
docker.push: $(base.all:%=docker.%)
67+
docker.push: $(base.all:%=docker.push.%)

Diff for: docs/en/contribution/compiling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ folders if you are using IntelliJ IDE.
2424
# Building Docker images
2525

2626
After you have [compiled the project](#compiling-project) and have generated the `skywalking-agent` folder, you can
27-
build Docker images. [`make docker`] builds the agent Docker images based on `alpine` image and `java8 ~ java 17`
27+
build Docker images. [`make docker`] builds the agent Docker images based on `alpine` image, `java8`, `java11` and `java 17`
2828
images by default. If you want to only build part of the images, add suffix `.alpine` or `.java<x>` to the `make`
2929
target, for example:
3030

Diff for: test/e2e/base/base-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
JAVA_TOOL_OPTIONS: -javaagent:/skywalking/agent/skywalking-agent.jar=agent.instance_properties[org]=apache
5050
SW_INSTANCE_PROPERTIES_JSON: "{\"org\": \"apache-skywalking\"}"
5151
healthcheck:
52-
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
52+
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9090" ]
5353
interval: 5s
5454
timeout: 60s
5555
retries: 120
@@ -70,7 +70,7 @@ services:
7070
SW_AGENT_INSTANCE_NAME: consumer1
7171
SW_LOGGING_OUTPUT: CONSOLE
7272
healthcheck:
73-
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 9090"]
73+
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9090"]
7474
interval: 5s
7575
timeout: 60s
7676
retries: 120

Diff for: test/e2e/base/consumer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ FROM skywalking/skywalking-java:latest-java8
1717

1818
ARG ENABLE_KAFKA_REPORTER
1919

20-
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
20+
RUN if [ "${ENABLE_KAFKA_REPORTER}" = "true" ]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
2121

2222
VOLUME /services
2323
ADD target/e2e-service-consumer.jar /services/
2424

2525
ENV JAVA_OPTS=""
2626

27-
CMD ["sh", "-c", "java $JAVA_OPTS -jar /services/e2e-service-consumer.jar"]
27+
CMD ["bash", "-c", "java $JAVA_OPTS -jar /services/e2e-service-consumer.jar"]

Diff for: test/e2e/base/provider/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ FROM skywalking/skywalking-java:latest-java8
1717

1818
ARG ENABLE_KAFKA_REPORTER
1919

20-
RUN if [[ "${ENABLE_KAFKA_REPORTER}" == "true" ]]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
20+
RUN if [ "${ENABLE_KAFKA_REPORTER}" = "true" ]; then cp -rf /skywalking/agent/optional-reporter-plugins/* /skywalking/agent/plugins/ ; fi
2121

2222
VOLUME /services
2323
ADD target/e2e-service-provider.jar /services/
2424

2525
ENV JAVA_OPTS=""
2626

27-
CMD ["sh", "-c", "java $JAVA_OPTS -jar /services/e2e-service-provider.jar"]
27+
CMD ["bash", "-c", "java $JAVA_OPTS -jar /services/e2e-service-provider.jar"]

Diff for: test/e2e/case/kafka/e2e.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@
1818
setup:
1919
env: compose
2020
file: docker-compose.yml
21-
timeout: 1200
21+
timeout: 20m
2222
init-system-environment: ../../script/env
2323
steps:
2424
- name: install yq
2525
command: bash test/e2e/script/prepare/install.sh yq
2626
- name: install swctl
2727
command: bash test/e2e/script/prepare/install.sh swctl
2828

29-
cleanup:
30-
# always never success failure
31-
on: always
32-
3329
trigger:
3430
action: http
3531
interval: 3s

0 commit comments

Comments
 (0)