From 78866163f141d572c643d6ae8f656ee920782f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=A9=E8=BD=A9?= Date: Mon, 9 Oct 2023 11:40:15 +0800 Subject: [PATCH] fix container boot mode --- Dockerfile | 7 ++++--- raven.sh | 5 +---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1b327e..258c539 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG TARGETOS ARG TARGETARCH # Build -RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o agent cmd/agent/main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o raven-agent-ds cmd/agent/main.go FROM alpine:3.17 @@ -30,7 +30,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && touch /run/openrc/softlevel \ && rc-update add ipsec -COPY --from=builder /workspace/agent /usr/local/bin/ +COPY --from=builder /workspace/raven-agent-ds /usr/local/bin/ COPY pluto raven.sh /usr/local/bin/ -ENTRYPOINT raven.sh \ No newline at end of file +ENTRYPOINT raven.sh +ENTRYPOINT ["/usr/local/bin/raven-agent-ds"] \ No newline at end of file diff --git a/raven.sh b/raven.sh index bd97a3d..7d5780e 100755 --- a/raven.sh +++ b/raven.sh @@ -18,7 +18,4 @@ set -e -x # disable icmp redirect -[ "$(cat /proc/sys/net/ipv4/conf/all/send_redirects)" = 0 ] || echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects - -# run raven agent -exec agent --node-name="$NODE_NAME" --vpn-driver="$VPN_DRIVER" --forward-node-ip="$FORWARD_NODE_IP" --metric-bind-addr="$METRIC_BIND_ADDR" --feature-gates="$FEATURE_GATES" \ No newline at end of file +[ "$(cat /proc/sys/net/ipv4/conf/all/send_redirects)" = 0 ] || echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects \ No newline at end of file