Skip to content

Commit

Permalink
fix: Add version ldflags for building manager-api
Browse files Browse the repository at this point in the history
Signed-off-by: imjoey <[email protected]>
  • Loading branch information
imjoey committed Jan 29, 2021
1 parent 619165a commit 00fa584
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,9 @@ WORKDIR /usr/local/apisix-dashboard

COPY --from=pre-build /usr/local/apisix-dashboard .

WORKDIR /usr/local/apisix-dashboard/api

RUN mkdir -p ../output/conf \
&& cp ./conf/*.json ../output/conf

RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz -O /tmp/v1.1.tar.gz \
&& mkdir /tmp/dag-to-lua \
&& tar -xvf /tmp/v1.1.tar.gz -C /tmp/dag-to-lua --strip 1 \
&& mkdir -p ../output/dag-to-lua \
&& mv /tmp/dag-to-lua/lib/* ../output/dag-to-lua/

RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w GOPROXY=https://goproxy.io,direct ; fi

RUN go env -w GO111MODULE=on \
&& CGO_ENABLED=0 go build -o ../output/manager-api ./cmd/manager
RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w GOPROXY=https://goproxy.io,direct ; fi \
&& go env -w GO111MODULE=on \
&& CGO_ENABLED=0 ./api/build.sh

FROM node:14-alpine as fe-builder

Expand All @@ -57,11 +45,9 @@ COPY --from=pre-build /usr/local/apisix-dashboard .

WORKDIR /usr/local/apisix-dashboard/web

RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry https://registry.npm.taobao.org/ ; fi

RUN yarn install

RUN yarn build
RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry https://registry.npm.taobao.org/ ; fi \
&& yarn install \
&& yarn build

FROM alpine:latest as prod

Expand Down

0 comments on commit 00fa584

Please sign in to comment.