Skip to content

Commit 593a92c

Browse files
kizuna-lekapecloud-bot
authored andcommitted
chore: simplfy es agent image (#2567)
(cherry picked from commit 523b7d9)
1 parent 006b4a8 commit 593a92c

3 files changed

Lines changed: 3 additions & 22 deletions

File tree

addons/elasticsearch/agent/Dockerfile

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,17 @@ FROM golang:1.23-alpine AS builder
22

33
WORKDIR /app
44

5-
# Copy go mod files
65
COPY go.mod go.sum ./
7-
8-
# Download dependencies
96
RUN go mod download
107

11-
# Copy source code
128
COPY main.go ./
13-
14-
# Build application
159
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o agent main.go
1610

17-
# Use elasticsearch base image to access elasticsearch-keystore command
18-
FROM docker.io/elasticsearch:8.8.2
19-
20-
# Install necessary tools
21-
USER root
22-
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
11+
FROM alpine:3.21
2312

24-
# Copy agent binary
2513
COPY --from=builder /app/agent /usr/local/bin/agent
26-
27-
# Make agent executable
2814
RUN chmod +x /usr/local/bin/agent
2915

30-
# Switch back to elasticsearch user
31-
USER elasticsearch
32-
33-
# Expose agent port
3416
EXPOSE 8080
3517

36-
# Start agent
3718
CMD ["/usr/local/bin/agent"]

addons/elasticsearch/agent/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
IMAGE_REGISTRY ?= apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com
44
IMAGE_REPOSITORY ?= apecloud/elasticsearch-agent
5-
IMAGE_TAG ?= 0.1.0
5+
IMAGE_TAG ?= 0.1.1
66
FULL_IMAGE_NAME = $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY):$(IMAGE_TAG)
77
PLATFORMS ?= linux/amd64,linux/arm64
88

addons/elasticsearch/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ image:
3333
tag: "8.8.2"
3434
agent:
3535
repository: apecloud/elasticsearch-agent
36-
tag: "0.1.0"
36+
tag: "0.1.1"
3737
# elasticsearch-dump: https://github.com/elasticsearch-dump/elasticsearch-dump
3838
esDump:
3939
repository: elasticdump/elasticsearch-dump

0 commit comments

Comments
 (0)