Skip to content

Commit

Permalink
fix container boot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
珩轩 committed Oct 9, 2023
1 parent dc359e5 commit 7886616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
ENTRYPOINT raven.sh
ENTRYPOINT ["/usr/local/bin/raven-agent-ds"]
5 changes: 1 addition & 4 deletions raven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
[ "$(cat /proc/sys/net/ipv4/conf/all/send_redirects)" = 0 ] || echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects

0 comments on commit 7886616

Please sign in to comment.