본문으로 건너뛰기
cccskills
무료GitHub에 공개

package

Rebuild SkyWalking’s distribution and OAP Docker image after source changes, choosing a command sequence that includes the updated JARs. It also explains how to inspect the image contents before running end-to-end tests.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Rebuild the SkyWalking distribution and OAP Docker image after source changes. Use before running e2e tests so the image reflects your code changes. Avoids the "image looks updated but runtime has stale jars" trap.

apache/skywalking스타 24,978(GitHub 24,978 + cccskills 0)
연동 도구Docker

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Rebuilding an OAP image after Java source changes
  • Updating the distribution package before Docker builds
  • Checking that a fix reached the image before E2E tests

포함된 파일(1)

  • SKILL.md5.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Package OAP Distribution & Docker Image

Rebuilding the Docker image after a source-code change has a two-step dependency: rebuild the dist tarball, then rebuild the image. Skipping the first step silently produces an image with stale jars — the Docker build still "succeeds," the image has a fresh timestamp, but the embedded jar is the one from your previous build.

Why this matters

make docker.oap in the root Makefile is defined as:

docker.% push.docker.%: $(CONTEXT)/$(DIST) $(SW_ROOT)/docker/%/*
    $(DOCKER_RULE)

It depends on $(CONTEXT)/$(DIST) (the dist tarball) as a file prerequisite. If that tarball already exists, make does not regenerate it — it just copies whatever is on disk into dist/docker_build/oap/ and runs docker buildx build. There is no dependency that rebuilds the tarball from source.

Only make docker triggers the full chain (init → build.all → docker.all). So:

CommandRebuilds source?Rebuilds tarball?Rebuilds image?
./mvnw -pl <module> packageonly that modulenono
./mvnw -pl apm-dist -am package -Pbackend,distall backend deps + distyesno
make docker.oapnono (uses whatever's on disk)yes
make dockeryes (build.all)yesyes (docker.all)

flatten:flatten — always run it before package/install

SkyWalking's poms use ${revision} as a placeholder version (e.g., 10.5.0-SNAPSHOT). The flatten-maven-plugin resolves ${revision} into concrete versions and writes a .flattened-pom.xml. Without it:

  • Installed artifacts carry the literal string ${revision} in their coordinates and cannot be resolved as dependencies.
  • Downstream modules (including apm-dist) see an inconsistent dependency graph.
  • Symptoms are subtle: -pl <module> -am may succeed in isolation but fail or pull in stale transitive artifacts when the same module is consumed by another build invocation in the same session.

Always run flatten:flatten in the same goal chain as package or install. The CI dist-tar job and the compile skill both do this. Example:

./mvnw clean flatten:flatten package -Pbackend,dist -DskipTests

Not optional — treat it as part of package.

Pick the right command

Changed OAP source → want a new image

# Recommended: full chain
make docker

or, faster and equivalent for backend-only changes (skips UI):

./mvnw -pl apm-dist -am -o clean flatten:flatten package -Pbackend,dist -DskipTests -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true
make docker.oap

Do not just run make docker.oap after a code edit — the image will look rebuilt but your change will not be in the jars. Do not skip flatten:flatten — see the section above.

Changed only the dist packaging (e.g., apm-dist/, log4j2.xml)

./mvnw -pl apm-dist -am -o clean flatten:flatten package -Pbackend,dist -DskipTests
make docker.oap

Changed only Dockerfile / entrypoint (docker/oap/*)

The tarball is untouched, so make docker.oap alone is correct:

make docker.oap

Verify the fix reached the image

Docker's "image created" timestamp updates even when the content is stale (because --no-cache is used). Don't trust the timestamp. Verify the jar contents directly:

# Copy the jar out of the container
docker cp <container-name>:/skywalking/oap-libs/<module>-<version>.jar /tmp/verify.jar

# Extract the specific class
cd /tmp && jar -xf verify.jar <path/to/YourClass.class>

# Grep for a string your fix introduced (unique literal, method name, etc.)
grep -oa "myFixSignature" <path/to/YourClass.class>

If grep finds nothing, the image does not contain your fix — you forgot to rebuild the dist. Re-run with the correct chain.

Common pitfalls

  • make docker.oap after ./mvnw package: The module jar is fresh in oap-server/.../target/, but the dist tarball at dist/apache-skywalking-apm-bin.tar.gz is untouched. Image uses the old jar.
  • Cancelling a make docker mid-flight: leaves the dist half-rebuilt. Re-run make docker or delete dist/ first.
  • Stale buildx cache: not usually the issue (the Makefile passes --no-cache), but if you suspect it, run docker buildx prune.
  • Trusting image timestamps: docker images shows when the image was tagged, not when its content actually changed. A no-op rebuild still updates the timestamp.
  • Interactive buildx hangs: if docker buildx build sits silent for minutes with no stdout, kill it and retry. The buildx container driver occasionally stalls; a restart is faster than waiting.

The golden rule

After any Java source edit that affects code shipped in oap-libs/, run one of:

  1. make docker (full, safest)
  2. ./mvnw -pl apm-dist -am -o package -Pbackend,dist -DskipTests -Dcheckstyle.skip=true && make docker.oap (fast)

Then verify the fix is in the image's jar before running e2e. Don't assume.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

ci-e2e-debug

무료요약 있음

GitHub Actions에서 실패한 E2E 테스트를 조사하는 스킬입니다. 실행 로그 산출물을 가져와 OAP와 다른 구성 요소의 오류를 확인하고, 별도 테스트 프로세스의 실패까지 포함해 원인 후보를 정리합니다.

  • GitHub Actions E2E 실패 조사
  • OAP, BanyanDB, UI 로그 확인
  • 별도 테스트 프로세스의 실패 추적
apache/skywalking2.5만2026년 10월 29일 업데이트

compile

무료요약 있음

Maven 래퍼로 SkyWalking OAP의 백엔드 또는 전체 프로젝트를 빌드하고 Javadoc과 Checkstyle을 확인합니다. PR 제출 전에 전체 빌드, 빠른 백엔드 빌드, 단일 모듈 빌드나 개별 검사를 선택할 수 있습니다.

  • PR 전에 전체 빌드 실행
  • Javadoc 오류와 경고 확인
  • 수정한 모듈만 빌드
apache/skywalking2.5만2026년 10월 29일 업데이트

generate-classes

무료요약 있음

SkyWalking의 MAL, OAL, LAL 또는 Hierarchy DSL 스크립트를 컴파일해 생성된 `.class` 파일을 조사할 수 있도록 저장합니다. DSL 하나를 선택하거나 네 종류 모두 생성하고, `javap`으로 바이트코드를 확인하는 방법을 안내합니다.

  • MAL 식에서 생성된 클래스 조사
  • OAL 지표와 디스패처 클래스 확인
  • LAL 또는 Hierarchy 출력 조사
apache/skywalking2.5만2026년 10월 29일 업데이트

gh-pull-request

무료요약 있음

PR 브랜치의 변경 사항을 빌드, Checkstyle, 라이선스 헤더, Java 클래스 이름 검사로 확인하고 커밋한 뒤 푸시합니다. PR이 없으면 프로젝트 템플릿에 따라 생성합니다.

  • PR 제출 전에 변경 사항 확인
  • 브랜치 변경 사항 커밋 및 푸시
  • 현재 브랜치에서 PR 생성
apache/skywalking2.5만2026년 10월 29일 업데이트

license

무료요약 있음

`license-eye`로 소스 파일의 Apache 2.0 라이선스 헤더와 의존성 라이선스 목록을 확인합니다. 헤더를 수정하거나 목록을 다시 생성하고, PR 제출 전에 변경 내용을 검토할 수 있습니다.

  • PR 제출 전 Apache 헤더 확인
  • 누락된 라이선스 헤더 수정
  • 의존성 라이선스 목록 차이 검토
apache/skywalking2.5만2026년 10월 29일 업데이트

new-monitoring-feature

무료요약 있음

SkyWalking OAP에 모니터링 대상이나 Layer를 추가할 때 신호별 확장 지점을 정리하고 Layer 등록, UI 템플릿, 문서, 로컬 검증 등 함께 필요한 작업을 파악하도록 돕습니다.

  • 새 모니터링 Layer 변경 계획
  • 메트릭·로그 확장 지점 선택
  • Layer 추가에 따른 UI·문서 항목 정리
apache/skywalking2.5만2026년 10월 29일 업데이트

apache의 스킬 모두 보기

이 스킬의 문제 신고