Skip to content

Commit

Permalink
docker: cache vendor to speed up docker build (#10296)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddontang authored and zz-jason committed May 22, 2019
1 parent 54899f6 commit 54f9459
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ RUN apk add --no-cache \
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \
&& chmod +x /usr/local/bin/dumb-init

COPY . /go/src/github.com/pingcap/tidb
RUN mkdir -p /go/src/github.com/pingcap/tidb
WORKDIR /go/src/github.com/pingcap/tidb

WORKDIR /go/src/github.com/pingcap/tidb/
# Cache dependencies
COPY go.mod .
COPY go.sum .

RUN GO111MODULE=on go mod download

# Build real binaries
COPY . .
RUN make

# Executable image
Expand All @@ -27,4 +34,4 @@ WORKDIR /

EXPOSE 4000

ENTRYPOINT ["/usr/local/bin/dumb-init", "/tidb-server"]
ENTRYPOINT ["/usr/local/bin/dumb-init", "/tidb-server"]

0 comments on commit 54f9459

Please sign in to comment.