Fix docker build error
This commit is contained in:
parent
76e8e35e81
commit
12b4700397
17
.travis.yml
17
.travis.yml
@ -17,25 +17,10 @@ install:
|
||||
|
||||
script:
|
||||
- |
|
||||
# Translate to alternative arch names used in multiarch images
|
||||
if [ "$IMAGE_ARCH" == "amd64" ]; then IMAGE_ARCH_ALT=amd64 ; fi
|
||||
if [ "$IMAGE_ARCH" == "i386" ]; then IMAGE_ARCH_ALT=i386 ; fi
|
||||
if [ "$IMAGE_ARCH" == "arm32v7" ]; then IMAGE_ARCH_ALT=armhf ; fi
|
||||
if [ "$IMAGE_ARCH" == "arm64v8" ]; then IMAGE_ARCH_ALT=aarch64; fi
|
||||
|
||||
# Translate to alternative arch names used in golang
|
||||
if [ "$IMAGE_ARCH" == "amd64" ]; then IMAGE_ARCH_GO=amd64; fi
|
||||
if [ "$IMAGE_ARCH" == "i386" ]; then IMAGE_ARCH_GO=386 ; fi
|
||||
if [ "$IMAGE_ARCH" == "arm32v7" ]; then IMAGE_ARCH_GO=arm ; fi
|
||||
if [ "$IMAGE_ARCH" == "arm64v8" ]; then IMAGE_ARCH_GO=arm64; fi
|
||||
|
||||
# Build image
|
||||
docker build \
|
||||
-t $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH \
|
||||
-f $PROGRAM/Dockerfile \
|
||||
--build-arg IMAGE_ARCH=$IMAGE_ARCH \
|
||||
--build-arg IMAGE_ARCH_ALT=$IMAGE_ARCH_ALT \
|
||||
--build-arg IMAGE_ARCH_GO=$IMAGE_ARCH_GO \
|
||||
-f $PROGRAM/Dockerfile.$IMAGE_ARCH \
|
||||
$PROGRAM
|
||||
|
||||
# Tag image :{arch} and :{arch}-build{build number}
|
||||
|
@ -1,8 +1,7 @@
|
||||
ARG THIS_ARCH_ALT=amd64
|
||||
FROM ${THIS_ARCH}/debian:buster
|
||||
FROM amd64/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=${THIS_ARCH_GO}
|
||||
ENV GOOS=linux GOARCH=amd64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang \
|
13
frontend/Dockerfile.arm32v7
Normal file
13
frontend/Dockerfile.arm32v7
Normal file
@ -0,0 +1,13 @@
|
||||
FROM arm32v7/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang \
|
||||
&& cd /root && go build -o /frontend \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/frontend"]
|
13
frontend/Dockerfile.arm64v8
Normal file
13
frontend/Dockerfile.arm64v8
Normal file
@ -0,0 +1,13 @@
|
||||
FROM arm64v8/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang \
|
||||
&& cd /root && go build -o /frontend \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/frontend"]
|
13
frontend/Dockerfile.i386
Normal file
13
frontend/Dockerfile.i386
Normal file
@ -0,0 +1,13 @@
|
||||
FROM i386/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=386
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang \
|
||||
&& cd /root && go build -o /frontend \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/frontend"]
|
@ -1,8 +1,7 @@
|
||||
ARG THIS_ARCH_ALT=amd64
|
||||
FROM ${THIS_ARCH}/debian:buster
|
||||
FROM amd64/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=${THIS_ARCH_GO}
|
||||
ENV GOOS=linux GOARCH=amd64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute \
|
13
proxy/Dockerfile.arm32v7
Normal file
13
proxy/Dockerfile.arm32v7
Normal file
@ -0,0 +1,13 @@
|
||||
FROM arm32v7/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute \
|
||||
&& cd /root && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
13
proxy/Dockerfile.arm64v8
Normal file
13
proxy/Dockerfile.arm64v8
Normal file
@ -0,0 +1,13 @@
|
||||
FROM arm64v8/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute \
|
||||
&& cd /root && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
13
proxy/Dockerfile.i386
Normal file
13
proxy/Dockerfile.i386
Normal file
@ -0,0 +1,13 @@
|
||||
FROM i386/debian:buster
|
||||
|
||||
LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=386
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute \
|
||||
&& cd /root && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
Loading…
x
Reference in New Issue
Block a user