general: add s390x & ppc64le

This commit is contained in:
Lan Tian 2020-11-07 20:24:37 +08:00
parent 538699ccd2
commit 5000ad1bbf
No known key found for this signature in database
GPG Key ID: 3D2E9DC81E5791C7
5 changed files with 68 additions and 0 deletions

View File

@ -8,10 +8,14 @@ env:
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=amd64
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=ppc64le
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=s390x
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=ppc64le
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=s390x
install:
- docker run --rm --privileged multiarch/qemu-user-static:register --reset

View File

@ -0,0 +1,9 @@
FROM golang:buster AS step_0
ENV CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le GO111MODULE=on
WORKDIR /root
COPY . .
RUN go build -o /frontend
FROM scratch AS step_1
COPY --from=step_0 /frontend /
ENTRYPOINT ["/frontend"]

View File

@ -0,0 +1,9 @@
FROM golang:buster AS step_0
ENV CGO_ENABLED=0 GOOS=linux GOARCH=s390x GO111MODULE=on
WORKDIR /root
COPY . .
RUN go build -o /frontend
FROM scratch AS step_1
COPY --from=step_0 /frontend /
ENTRYPOINT ["/frontend"]

23
proxy/Dockerfile.ppc64le Normal file
View File

@ -0,0 +1,23 @@
FROM golang:buster AS step_0
ENV CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le GO111MODULE=on
WORKDIR /root
COPY . .
RUN go build -o /proxy
FROM ppc64le/debian:sid AS step_1
ENV TARGET_ARCH=ppc64le
WORKDIR /root
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y \
build-essential musl-dev musl-tools tar wget git
RUN git clone https://github.com/sabotage-linux/kernel-headers.git
RUN wget https://sourceforge.net/projects/traceroute/files/traceroute/traceroute-2.1.0/traceroute-2.1.0.tar.gz/download \
-O traceroute-2.1.0.tar.gz
RUN tar xvf traceroute-2.1.0.tar.gz \
&& cd traceroute-2.1.0 \
&& make -j4 CC=musl-gcc CFLAGS="-I/root/kernel-headers/${TARGET_ARCH}/include" LDFLAGS="-static"
FROM scratch AS step_2
ENV PATH=/
COPY --from=step_0 /proxy /
COPY --from=step_1 /root/traceroute-2.1.0/traceroute/traceroute /
ENTRYPOINT ["/proxy"]

23
proxy/Dockerfile.s390x Normal file
View File

@ -0,0 +1,23 @@
FROM golang:buster AS step_0
ENV CGO_ENABLED=0 GOOS=linux GOARCH=s390x GO111MODULE=on
WORKDIR /root
COPY . .
RUN go build -o /proxy
FROM s390x/debian:sid AS step_1
ENV TARGET_ARCH=s390
WORKDIR /root
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y \
build-essential musl-dev musl-tools tar wget git
RUN git clone https://github.com/sabotage-linux/kernel-headers.git
RUN wget https://sourceforge.net/projects/traceroute/files/traceroute/traceroute-2.1.0/traceroute-2.1.0.tar.gz/download \
-O traceroute-2.1.0.tar.gz
RUN tar xvf traceroute-2.1.0.tar.gz \
&& cd traceroute-2.1.0 \
&& make -j4 CC=musl-gcc CFLAGS="-I/root/kernel-headers/${TARGET_ARCH}/include" LDFLAGS="-static"
FROM scratch AS step_2
ENV PATH=/
COPY --from=step_0 /proxy /
COPY --from=step_1 /root/traceroute-2.1.0/traceroute/traceroute /
ENTRYPOINT ["/proxy"]