Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
fix: pass GOPROXY to docker build
Browse files Browse the repository at this point in the history
Signed-off-by: lowzj <[email protected]>
  • Loading branch information
lowzj committed May 12, 2020
1 parent bd47d0c commit 386e25f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
49 changes: 25 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
FROM golang:1.12.10-alpine as builder

WORKDIR /go/src/github.com/dragonflyoss/Dragonfly
RUN apk --no-cache add bash make gcc libc-dev git

COPY . /go/src/github.com/dragonflyoss/Dragonfly

# make build dfdaemon and dfget.
# write the resulting executable to the dir /opt/dragonfly/df-client.
RUN make build-client && make install-client

FROM alpine:3.8

RUN apk --no-cache add ca-certificates bash

COPY --from=builder /opt/dragonfly/df-client /opt/dragonfly/df-client

# dfdaemon will listen 65001 in default.
EXPOSE 65001

# use the https://index.docker.io as default registry.
CMD [ "--registry", "https://index.docker.io" ]

ENTRYPOINT [ "/opt/dragonfly/df-client/dfdaemon" ]
FROM golang:1.12.10-alpine as builder

WORKDIR /go/src/github.com/dragonflyoss/Dragonfly
RUN apk --no-cache add bash make gcc libc-dev git

COPY . /go/src/github.com/dragonflyoss/Dragonfly

# make build dfdaemon and dfget.
# write the resulting executable to the dir /opt/dragonfly/df-client.
ARG GOPROXY
RUN make build-client && make install-client

FROM alpine:3.8

RUN apk --no-cache add ca-certificates bash

COPY --from=builder /opt/dragonfly/df-client /opt/dragonfly/df-client

# dfdaemon will listen 65001 in default.
EXPOSE 65001

# use the https://index.docker.io as default registry.
CMD [ "--registry", "https://index.docker.io" ]

ENTRYPOINT [ "/opt/dragonfly/df-client/dfdaemon" ]
1 change: 1 addition & 0 deletions Dockerfile.supernode
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ COPY . /go/src/github.com/dragonflyoss/Dragonfly

# go build supernode.
# write the resulting executable to the dir /opt/dragonfly/df-supernode.
ARG GOPROXY
RUN make build-supernode && make install-supernode

FROM dragonflyoss/nginx:apline
Expand Down
4 changes: 2 additions & 2 deletions hack/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ curDir=$(cd "$(dirname "$0")" && pwd)
cd "${curDir}/../" || return

docker-build::build-dfclient(){
docker build -t dfclient:"${DF_VERSION}" -f Dockerfile .
docker build --build-arg GOPROXY="${GOPROXY}" -t dfclient:"${DF_VERSION}" -f Dockerfile .
}

docker-build::build-supernode(){
docker build -t supernode:"${DF_VERSION}" -f Dockerfile.supernode .
docker build --build-arg GOPROXY="${GOPROXY}" -t supernode:"${DF_VERSION}" -f Dockerfile.supernode .
}

main() {
Expand Down

0 comments on commit 386e25f

Please sign in to comment.