mirror of https://github.com/xddxdd/bird-lg-go
proxy: add docker image with mtr
This commit is contained in:
parent
5b5a44bcb6
commit
6a78cf2e80
|
@ -67,7 +67,7 @@ jobs:
|
|||
with:
|
||||
context: '{{defaultContext}}:frontend'
|
||||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
|
||||
push: true
|
||||
push: true{context}/Dockerfile
|
||||
tags: |
|
||||
xddxdd/bird-lg-go:latest
|
||||
xddxdd/bird-lg-go:${{ github.event.release.tag_name }}
|
||||
|
@ -85,3 +85,16 @@ jobs:
|
|||
xddxdd/bird-lgproxy-go:${{ github.event.release.tag_name }}
|
||||
ghcr.io/xddxdd/bird-lg-go:proxy
|
||||
ghcr.io/xddxdd/bird-lg-go:proxy-${{ github.event.release.tag_name }}
|
||||
|
||||
- name: Build proxy docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: '{{defaultContext}}:proxy'
|
||||
file: '{context}/Dockerfile.mtr'
|
||||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
|
||||
push: true
|
||||
tags: |
|
||||
xddxdd/bird-lgproxy-go:latest-mtr
|
||||
xddxdd/bird-lgproxy-go:${{ github.event.release.tag_name }}-mtr
|
||||
ghcr.io/xddxdd/bird-lg-go:proxy-mtr
|
||||
ghcr.io/xddxdd/bird-lg-go:proxy-${{ github.event.release.tag_name }}-mtr
|
||||
|
|
|
@ -20,7 +20,3 @@ proxy/proxy
|
|||
|
||||
# don't include generated bindata file
|
||||
frontend/bindata.go
|
||||
|
||||
# don't include generated Dockerfiles
|
||||
frontend/Dockerfile.*
|
||||
proxy/Dockerfile.*
|
|
@ -0,0 +1,31 @@
|
|||
FROM golang AS step_0
|
||||
|
||||
ENV CGO_ENABLED=0 GO111MODULE=on
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN go build -ldflags "-w -s" -o /proxy
|
||||
|
||||
################################################################################
|
||||
|
||||
FROM alpine:edge AS step_1
|
||||
|
||||
WORKDIR /root
|
||||
RUN apk add --no-cache build-base linux-headers
|
||||
|
||||
RUN wget https://www.bitwizard.nl/mtr/files/mtr-0.94.tar.gz \
|
||||
-O mtr-0.94.tar.gz
|
||||
RUN tar xvf mtr-0.94.tar.gz \
|
||||
&& cd mtr-0.94 \
|
||||
&& ./configure --without-gtk --without-ncurses --without-jansson --without-ipinfo --disable-bash-completion \
|
||||
&& make -j4 LDFLAGS="-static" \
|
||||
&& strip /root/mtr-0.94/mtr \
|
||||
&& strip /root/mtr-0.94/mtr-packet
|
||||
|
||||
################################################################################
|
||||
|
||||
FROM scratch AS step_2
|
||||
ENV PATH=/
|
||||
COPY --from=step_0 /proxy /
|
||||
COPY --from=step_1 /root/mtr-0.94/mtr /
|
||||
COPY --from=step_1 /root/mtr-0.94/mtr-packet /
|
||||
ENTRYPOINT ["/proxy"]
|
Loading…
Reference in New Issue