speed up building docker image
By using gx install --local, deps are copied into the build context and therefore only stale deps will get pulled from the network on image build. License: MIT Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
This commit is contained in:
parent
753322cdc1
commit
88f08e86b0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,6 +6,7 @@ deptools
|
|||
sharness/lib/sharness
|
||||
sharness/test-results
|
||||
sharness/trash*
|
||||
vendor/
|
||||
|
||||
raftFolderFromTest*
|
||||
peerstore
|
||||
|
|
|
@ -8,7 +8,7 @@ ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
|||
|
||||
COPY . $SRC_PATH
|
||||
WORKDIR $SRC_PATH
|
||||
RUN make install
|
||||
RUN make docker_install
|
||||
|
||||
ENV SUEXEC_VERSION v0.2
|
||||
ENV TINI_VERSION v0.16.1
|
||||
|
|
11
Makefile
11
Makefile
|
@ -28,6 +28,10 @@ install: deps
|
|||
$(MAKE) -C ipfs-cluster-service install
|
||||
$(MAKE) -C ipfs-cluster-ctl install
|
||||
|
||||
docker_install: docker_deps
|
||||
$(MAKE) -C ipfs-cluster-service install
|
||||
$(MAKE) -C ipfs-cluster-ctl install
|
||||
|
||||
build: deps
|
||||
go build -ldflags "-X ipfscluster.Commit=$(shell git rev-parse HEAD)"
|
||||
$(MAKE) -C ipfs-cluster-service build
|
||||
|
@ -64,6 +68,13 @@ deps: gx
|
|||
$(gx_bin) install --global
|
||||
$(gx-go_bin) rewrite
|
||||
|
||||
# Run this target before building the docker image
|
||||
# and then gx won't attempt to pull all deps
|
||||
# from the network each time
|
||||
docker_deps: gx
|
||||
$(gx_bin) install --local
|
||||
$(gx-go_bin) rewrite
|
||||
|
||||
check:
|
||||
go vet ./...
|
||||
golint -set_exit_status -min_confidence 0.3 ./...
|
||||
|
|
Loading…
Reference in New Issue
Block a user