This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git
The following commit(s) were added to refs/heads/main by this push:
new 831aefc fix(build): fix build error (#225)
831aefc is described below
commit 831aefc29f7d162c3adb2ed364c28da3dcb58dd3
Author: kezhenxu94 <[email protected]>
AuthorDate: Tue Dec 16 11:58:06 2025 +0800
fix(build): fix build error (#225)
---
.github/workflows/build-and-test.yaml | 3 ---
.github/workflows/publish-docker.yaml | 20 ++++++++++++++++----
Makefile | 14 +++++++++++---
docker/Dockerfile | 7 ++++---
4 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/build-and-test.yaml
b/.github/workflows/build-and-test.yaml
index e17acd9..4bb1a05 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -64,9 +64,6 @@ jobs:
- name: Check CI Consistency
if: matrix.runner == 'ubuntu'
run: make check
- - name: Build Docker
- if: matrix.runner == 'ubuntu'
- run: make docker
result:
runs-on: ubuntu-latest
diff --git a/.github/workflows/publish-docker.yaml
b/.github/workflows/publish-docker.yaml
index f32e331..d3a6f54 100644
--- a/.github/workflows/publish-docker.yaml
+++ b/.github/workflows/publish-docker.yaml
@@ -15,16 +15,14 @@
# limitations under the License.
name: publish-docker
-
on:
push:
branches:
- main
+ pull_request:
workflow_dispatch:
-
env:
HUB: ghcr.io/apache/skywalking-satellite
-
jobs:
build:
if: github.repository == 'apache/skywalking-satellite'
@@ -33,6 +31,11 @@ jobs:
contents: read
packages: write
timeout-minutes: 90
+ services:
+ registry:
+ image: registry:3
+ ports:
+ - 5000:5000
env:
VERSION: ${{ github.sha }}
steps:
@@ -40,12 +43,21 @@ jobs:
with:
submodules: true
- name: Log in to the Container registry
+ if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.HUB }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build docker image
+ - name: Build and push docker image
run: |
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
+ export HUB=localhost:5000/skywalking-satellite
+ export USE_INSECURE_REGISTRY=true
+ fi
make docker || make docker
make docker.push || make docker.push
+ - name: Verify image in local registry
+ if: github.event_name == 'pull_request'
+ run: |
+ docker pull
localhost:5000/skywalking-satellite/skywalking-satellite:v${{ github.sha }}
diff --git a/Makefile b/Makefile
index e2044a5..d57f398 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,8 @@ VERSION ?= latest
HUB ?= apache
OUT_DIR = bin
BINARY = skywalking-satellite
+USE_INSECURE_REGISTRY ?=
+INSECURE_REGISTRY_ARG = "--output=type=registry,registry.insecure=true"
RELEASE_BIN = skywalking-satellite-$(VERSION)-bin
RELEASE_SRC = skywalking-satellite-$(VERSION)-src
@@ -110,12 +112,18 @@ docker docker.push:
$(DOCKER_RULE)
define DOCKER_RULE
- docker buildx create --use --driver docker-container --name
skywalking_satellite > /dev/null 2>&1 || true
- docker buildx build $(PLATFORMS) $(LOAD_OR_PUSH) \
+ docker buildx create --use \
+ --driver docker-container \
+ --driver-opt network=host \
+ --buildkitd-flags '--allow-insecure-entitlement network.host' \
+ --name skywalking_satellite > /dev/null 2>&1 || true
+ docker buildx build \
+ $(if $(USE_INSECURE_REGISTRY),$(INSECURE_REGISTRY_ARG),) \
+ $(PLATFORMS) $(LOAD_OR_PUSH) \
--no-cache --build-arg VERSION=$(VERSION) \
-t $(HUB)/skywalking-satellite:v$(VERSION) \
-f docker/Dockerfile \
- --provenance=false \
+ --provenance=false \
.
docker buildx rm skywalking_satellite || true
endef
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 734bc8e..4c62509 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM golang:1.25 as build
+FROM golang:1.25 AS build
ARG VERSION="latest"
ARG TARGETARCH
@@ -28,9 +28,10 @@ COPY . .
RUN VERSION=$VERSION make ARCH=${TARGETARCH} linux
RUN mv /src/bin/skywalking-satellite-${VERSION}-linux-${TARGETARCH}
/src/bin/skywalking-satellite
-FROM alpine:3
+FROM alpine:3.19
-RUN apk -U upgrade
+RUN apk add --no-cache ca-certificates && \
+ apk -U upgrade
VOLUME /skywalking/configs