mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-22 06:43:28 +00:00
Show image download size as human-readable approximation
Signed-off-by: Han Verstraete <welteki@pm.me>
This commit is contained in:
committed by
Alex Ellis
parent
4b132315c7
commit
e09f37e5cb
1
go.mod
1
go.mod
@ -13,6 +13,7 @@ require (
|
||||
github.com/docker/distribution v2.8.0+incompatible
|
||||
github.com/docker/docker v17.12.0-ce-rc1.0.20191113042239-ea84732a7725+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.6.3 // indirect
|
||||
github.com/docker/go-units v0.4.0
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/morikuni/aec v1.0.0
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
units "github.com/docker/go-units"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
@ -112,7 +113,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
}
|
||||
images[svc.Name] = img
|
||||
size, _ := img.Size(ctx)
|
||||
fmt.Printf("Prepare done for: %s, %d bytes\n", svc.Image, size)
|
||||
fmt.Printf("Prepare done for: %s, %s\n", svc.Image, units.HumanSize(float64(size)))
|
||||
}
|
||||
|
||||
for _, svc := range svcs {
|
||||
|
1
vendor/modules.txt
generated
vendored
1
vendor/modules.txt
generated
vendored
@ -151,6 +151,7 @@ github.com/docker/go-connections/nat
|
||||
# github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
|
||||
github.com/docker/go-events
|
||||
# github.com/docker/go-units v0.4.0
|
||||
## explicit
|
||||
github.com/docker/go-units
|
||||
# github.com/gogo/googleapis v1.4.0
|
||||
github.com/gogo/googleapis/google/rpc
|
||||
|
Reference in New Issue
Block a user