Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2020-05-02 18:54:03 +02:00
Родитель 933bed5f5d
Коммит 33c45a0a62
11 изменённых файлов: 30 добавлений и 22 удалений

Просмотреть файл

@ -11,6 +11,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
protobuf-compiler \
libprotobuf-dev
RUN go get github.com/golang/protobuf/protoc-gen-go && \
go get golang.org/x/tools/cmd/goimports && \
go get gotest.tools/gotestsum
WORKDIR ${PWD}
ADD go.* ${PWD}
@ -34,10 +35,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
make xbins
FROM scratch AS protos
COPY --from=make-protos /go/src/github.com/docker/api/backend/v1/*.pb.go ./backend/v1/
COPY --from=make-protos /go/src/github.com/docker/api/compose/v1/*.pb.go ./compose/v1/
COPY --from=make-protos /go/src/github.com/docker/api/containers/v1/*.pb.go ./containers/v1/
COPY --from=make-protos /go/src/github.com/docker/api/cli/v1/*.pb.go ./cli/v1/
COPY --from=make-protos /go/src/github.com/docker/api .
FROM scratch AS bins
COPY --from=make-bins /go/src/github.com/docker/api/bin/* .

Просмотреть файл

@ -38,6 +38,7 @@ xbins: xcli xexample
protos:
@protoc -I. --go_out=plugins=grpc,paths=source_relative:. ${PROTOS}
@goimports -w -local github.com/docker/api .
cli: protos
GOOS=${GOOS} GOARCH=${GOARCH} go build -v -o bin/docker ./cli

Просмотреть файл

@ -34,14 +34,15 @@ package v1
import (
context "context"
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

Просмотреть файл

@ -33,8 +33,9 @@ import (
"os"
"text/tabwriter"
"github.com/docker/api/context/store"
"github.com/spf13/cobra"
"github.com/docker/api/context/store"
)
type CliContext struct {

Просмотреть файл

@ -5,9 +5,10 @@ import (
"os"
"text/tabwriter"
"github.com/docker/api/client"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/api/client"
)
var PsCommand = cobra.Command{

Просмотреть файл

@ -4,13 +4,14 @@ import (
"context"
"net"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
cliv1 "github.com/docker/api/cli/v1"
containersv1 "github.com/docker/api/containers/v1"
"github.com/docker/api/context/store"
"github.com/docker/api/server"
"github.com/docker/api/server/proxy"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Просмотреть файл

@ -40,12 +40,13 @@ import (
_ "github.com/docker/api/azure"
_ "github.com/docker/api/example"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/docker/api/cli/cmd"
apicontext "github.com/docker/api/context"
"github.com/docker/api/context/store"
"github.com/docker/api/util"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
type mainOpts struct {

Просмотреть файл

@ -34,14 +34,15 @@ package v1
import (
context "context"
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

Просмотреть файл

@ -34,14 +34,15 @@ package v1
import (
context "context"
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

Просмотреть файл

@ -34,14 +34,15 @@ package v1
import (
context "context"
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

Просмотреть файл

@ -31,15 +31,16 @@ import (
"context"
"errors"
"github.com/docker/api/client"
apicontext "github.com/docker/api/context"
"github.com/docker/api/context/store"
"github.com/docker/api/server/proxy"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/metadata"
"github.com/docker/api/client"
apicontext "github.com/docker/api/context"
"github.com/docker/api/context/store"
"github.com/docker/api/server/proxy"
)
// New returns a new GRPC server.