Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
add dfget to supernode dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: 玉海 <[email protected]>
  • Loading branch information
ansinlee committed Aug 10, 2020
1 parent ee974ae commit 3dbdf79
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12.10-alpine as builder
FROM golang:1.13.15-alpine as builder

WORKDIR /go/src/github.com/dragonflyoss/Dragonfly
RUN apk --no-cache add bash make gcc libc-dev git
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile.supernode
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12.10-alpine as builder
FROM golang:1.13.15-alpine as builder

WORKDIR /go/src/github.com/dragonflyoss/Dragonfly
RUN apk --no-cache add bash make gcc libc-dev git
Expand All @@ -9,6 +9,7 @@ COPY . /go/src/github.com/dragonflyoss/Dragonfly
# write the resulting executable to the dir /opt/dragonfly/df-supernode.
ARG GOPROXY
RUN make build-supernode && make install-supernode
RUN make build-client && make install-client

FROM dragonflyoss/nginx:apline

Expand All @@ -17,6 +18,9 @@ RUN apk --no-cache add ca-certificates bash
COPY --from=builder /go/src/github.com/dragonflyoss/Dragonfly/hack/start-supernode.sh /root/start.sh
COPY --from=builder /go/src/github.com/dragonflyoss/Dragonfly/hack/supernode-nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /opt/dragonfly/df-supernode/supernode /opt/dragonfly/df-supernode/supernode
COPY --from=builder /opt/dragonfly/df-client /opt/dragonfly/df-client
RUN ln -s /opt/dragonfly/df-client/dfget /usr/local/bin/dfget


# supernode will listen 8001,8002 in default.
EXPOSE 8001 8002
Expand Down
2 changes: 1 addition & 1 deletion hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DFDAEMON_BINARY_NAME=dfdaemon
DFGET_BINARY_NAME=dfget
SUPERNODE_BINARY_NAME=supernode
PKG=github.com/dragonflyoss/Dragonfly
BUILD_IMAGE=golang:1.12.10
BUILD_IMAGE=golang:1.13.15
VERSION=$(git describe --tags "$(git rev-list --tags --max-count=1)")
REVISION=$(git rev-parse --short HEAD)
DATE=$(date "+%Y%m%d-%H:%M:%S")
Expand Down
5 changes: 3 additions & 2 deletions supernode/server/preheat_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package server
import (
"context"
"net/http"
"time"

"github.com/dragonflyoss/Dragonfly/apis/types"
"github.com/dragonflyoss/Dragonfly/pkg/errortypes"
Expand Down Expand Up @@ -60,8 +61,8 @@ func (s *Server) getPreheatTask(ctx context.Context, rw http.ResponseWriter, req
}
resp := types.PreheatInfo{
ID: task.ID,
FinishTime: strfmt.NewDateTime(),
StartTime: strfmt.NewDateTime(),
FinishTime: strfmt.DateTime(time.Unix(task.FinishTime/1000, task.FinishTime%1000*int64(time.Millisecond)).UTC()),
StartTime: strfmt.DateTime(time.Unix(task.StartTime/1000, task.StartTime%1000*int64(time.Millisecond)).UTC()),
Status: task.Status,
}
return EncodeResponse(rw, http.StatusOK, resp)
Expand Down

0 comments on commit 3dbdf79

Please sign in to comment.