Git Product home page Git Product logo

Comments (5)

dawidd6 avatar dawidd6 commented on May 24, 2024

Perhaps we could change:

cli, err := client.NewEnvClient()

to

cli, err := client.NewClientWithOpts(client.WithVersion("1.24"))

Would need some testing.

from lazydocker.

warmchang avatar warmchang commented on May 24, 2024

@dawidd6 thank you for replay.

Do this change:

--- a/pkg/commands/docker.go
+++ b/pkg/commands/docker.go
@@ -61,7 +61,7 @@ func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {

 // NewDockerCommand it runs git commands
 func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
-       cli, err := client.NewEnvClient()
+       cli, err := client.NewClientWithOpts(client.WithVersion("1.24"))
        if err != nil {
                return nil, err
        }
$

Then build failed:

$ CGO_ENABLED=0 GOOS=linux go build
# github.com/jesseduffield/lazydocker/pkg/commands
pkg/commands/docker.go:64:14: undefined: client.NewClientWithOpts
pkg/commands/docker.go:64:39: undefined: client.WithVersion

from lazydocker.

dawidd6 avatar dawidd6 commented on May 24, 2024

@warmchang thanks for testing.

Well it seems like, lazydocker is using a very old release of Go Docker SDK and godoc.org is showing the documentation for newer API. Will need to dig this deeper.

from lazydocker.

dawidd6 avatar dawidd6 commented on May 24, 2024

@warmchang would be great if you could test this PR: #102

I would do that myself, but CentOS 7 has already 1.13.1 version of Docker.

from lazydocker.

warmchang avatar warmchang commented on May 24, 2024

@dawidd6 I made a quick test with PR #102 , it works fine! πŸ‘

[root@paas-controller-10-200-20-120:/home/ubuntu]$ docker version
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.7.5
 Git commit:   2e3ea0a2a31be47d1baacde97b3a68e3ce32a8ab
 Built:        2019-06-06 20:56:02
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.7.5
 Git commit:   2e3ea0a2a31be47d1baacde97b3a68e3ce32a8ab
 Built:        2019-06-06 20:56:02
 OS/Arch:      linux/amd64
[root@paas-controller-10-200-20-120:/home/ubuntu]$
[root@paas-controller-10-200-20-120:/home/ubuntu]$ ./lazydocker --help
lazydocker - The lazier way to manage everything docker
https://github.com/jesseduffield/lazydocker

  Flags:
       --version  Displays the program version string.
    -h --help  Displays help with available flag, subcommand, and positional value parameters.
    -c --config  Print the current default config
    -d --debug  a boolean
    -f --file  Specify alternate compose files

[root@paas-controller-10-200-20-120:/home/ubuntu]$
[root@paas-controller-10-200-20-120:/home/ubuntu]$ ./lazydocker
β”Œβ”€Projectβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€About─────────────────────────────────────────────────────────────────────┐
β”‚ubuntu                               β”‚β”‚   _                     _            _                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚  | |                   | |          | |                                   β”‚
β”Œβ”€Containers──────────────────────────┐│  | | __ _ _____   _  __| | ___   ___| | _____ _ __                        β”‚
β”‚running storage                      β”‚β”‚  | |/ _` |_  / | | |/ _` |/ _ \ / __| |/ / _ \ '__|                       β”‚
β”‚running pronoea                      β”‚β”‚  | | (_| |/ /| |_| | (_| | (_) | (__|   <  __/ |                          β”‚
β”‚running sqm                          β”‚β”‚  |_|\__,_/___|\__, |\__,_|\___/ \___|_|\_\___|_|                          β”‚
β”‚running prometheus                   β”‚β”‚                __/ |                                                      β”‚
β”‚running op-ubs-dbtools               β”‚β”‚               |___/                                                       β”‚
β”‚running eventmgt                     β”‚β”‚                                                                           β”‚
β”‚running zenap_kms                    β”‚β”‚                                                                           β”‚
β”‚running toposerver                   β”‚β”‚Copyright (c) 2019 Jesse Duffield                                          β”‚
β”‚running fm_mgt                       β”‚β”‚                                                                           β”‚
β”‚running keybox                       β”‚β”‚Keybindings: https://github.com/jesseduffield/lazydocker/blob/master/docs/kβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                                                                           β”‚
β”Œβ”€Images──────────────────────────────┐│Config Options: https://github.com/jesseduffield/lazydocker/blob/master/docβ”‚
β”‚swr:6666/admin/vnm                   β”‚β”‚                                                                           β”‚
β”‚swr:6666/admin/keybox                β”‚β”‚Raise an Issue: https://github.com/jesseduffield/lazydocker/issues         β”‚
β”‚swr:6666/admin/logapiserver          β”‚β”‚                                                                           β”‚
β”‚swr:6666/admin/zindexer              β”‚β”‚Buy Jesse a coffee: https://donorbox.org/lazydocker                        β”‚
β”‚swr:6666/admin/manager-cert          β”‚β”‚                                                                           β”‚
β”‚swr:6666/admin/utm                   β”‚β”‚Here's your lazydocker config when merged in with the defaults (you can opeβ”‚
β”‚swr:6666/admin/zenap_msb_apigateway  β”‚β”‚                                                                           β”‚
β”‚swr:6666/admin/fm_mgt                β”‚β”‚gui:                                                                       β”‚
β”‚swr:6666/admin/nats                  β”‚β”‚  scrollHeight: 2                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚  scrollPastBottom: false                                                  β”‚
β”Œβ”€Volumes─────────────────────────────┐│  mouseEvents: false                                                       β”‚
β”‚local 792da32c8fe1ab3a8b2a8b00878cd01β”‚β”‚  theme:                                                                   β”‚
β”‚local aabff1e4eb52c563bad9758001b71e3β”‚β”‚    activeBorderColor:                                                     β”‚
β”‚                                     β”‚β”‚    - green                                                                β”‚
β”‚                                     β”‚β”‚    - bold                                                                 β”‚
β”‚                                     β”‚β”‚    inactiveBorderColor:                                                   β”‚
β”‚                                     β”‚β”‚    - default                                                              β”‚
β”‚                                     β”‚β”‚    optionsTextColor:                                                      β”‚
β”‚                                     β”‚β”‚    - blue                                                                 β”‚
β”‚                                     β”‚β”‚  showAllContainers: false                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
PgUp/PgDn: scroll, esc/q: close, x: menu, ← β†’ ↑ ↓: navigate                            Donate lazydocker unversioned

from lazydocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.