Merge pull request #946 from ipfs/dockerfiles-improvs
Dockerfiles: download modules in advance
This commit is contained in:
commit
dcb6c0805b
12
Dockerfile
12
Dockerfile
|
@ -8,10 +8,6 @@ ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
|||
ENV GO111MODULE on
|
||||
ENV GOPROXY=https://proxy.golang.org
|
||||
|
||||
COPY . $SRC_PATH
|
||||
WORKDIR $SRC_PATH
|
||||
RUN make install
|
||||
|
||||
ENV SUEXEC_VERSION v0.2
|
||||
ENV TINI_VERSION v0.16.1
|
||||
RUN set -x \
|
||||
|
@ -27,6 +23,14 @@ RUN set -x \
|
|||
# Get the TLS CA certificates, they're not provided by busybox.
|
||||
RUN apt-get update && apt-get install -y ca-certificates
|
||||
|
||||
COPY go.* $SRC_PATH/
|
||||
WORKDIR $SRC_PATH
|
||||
RUN go mod download
|
||||
|
||||
COPY . $SRC_PATH
|
||||
RUN make install
|
||||
|
||||
|
||||
#------------------------------------------------------
|
||||
FROM busybox:1-glibc
|
||||
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
||||
|
|
|
@ -7,9 +7,14 @@ MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|||
# This builder just builds the cluster binaries
|
||||
ENV GOPATH /go
|
||||
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
||||
ENV GO111MODULE on
|
||||
ENV GOPROXY=https://proxy.golang.org
|
||||
|
||||
COPY go.* $SRC_PATH/
|
||||
WORKDIR $SRC_PATH
|
||||
RUN go mod download
|
||||
|
||||
COPY . $SRC_PATH
|
||||
WORKDIR $SRC_PATH
|
||||
RUN make install
|
||||
|
||||
#------------------------------------------------------
|
||||
|
|
|
@ -8,14 +8,16 @@ ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
|||
ENV GO111MODULE on
|
||||
ENV GOPROXY=https://proxy.golang.org
|
||||
|
||||
COPY . $SRC_PATH
|
||||
WORKDIR $SRC_PATH
|
||||
RUN make install
|
||||
|
||||
RUN cd /tmp && \
|
||||
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && \
|
||||
chmod +x jq-linux64
|
||||
|
||||
COPY go.* $SRC_PATH/
|
||||
WORKDIR $SRC_PATH
|
||||
RUN go mod download
|
||||
|
||||
COPY . $SRC_PATH
|
||||
RUN make install
|
||||
|
||||
#------------------------------------------------------
|
||||
FROM ipfs/go-ipfs:master
|
||||
|
|
1
Makefile
1
Makefile
|
@ -14,7 +14,6 @@ install:
|
|||
$(MAKE) -C cmd/ipfs-cluster-ctl install
|
||||
|
||||
build:
|
||||
go build -ldflags "-X ipfscluster.Commit=$(shell git rev-parse HEAD)"
|
||||
$(MAKE) -C cmd/ipfs-cluster-service build
|
||||
$(MAKE) -C cmd/ipfs-cluster-ctl build
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ SRC := $(shell find .. -type f -name '*.go')
|
|||
all: ipfs-cluster-ctl
|
||||
|
||||
ipfs-cluster-ctl: $(SRC)
|
||||
go build
|
||||
go build -mod=readonly
|
||||
|
||||
build: ipfs-cluster-ctl
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ SRC := $(shell find .. -type f -name '*.go')
|
|||
all: ipfs-cluster-service
|
||||
|
||||
ipfs-cluster-service: $(SRC)
|
||||
go build -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
|
||||
go build -mod=readonly -ldflags "-X main.commit=$(shell git rev-parse HEAD)"
|
||||
|
||||
build: ipfs-cluster-service
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user