Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile for CLI #730

Merged
merged 3 commits into from
May 29, 2018
Merged

Conversation

ryanwalls
Copy link
Contributor

Helps with #729. Would need someone to automate running it in your builds and pushing to docker hub.

@CLAassistant
Copy link

CLAassistant commented May 11, 2018

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented May 11, 2018

Coverage Status

Coverage increased (+0.1%) to 65.796% when pulling 987c0cc on ryanwalls:dockerize-cli into b764298 on uber:master.

@samarabbas
Copy link
Contributor

@vancexu can you take a look at this PR.

@vancexu
Copy link
Contributor

vancexu commented May 15, 2018

Thanks for this contribution @ryanwalls ! I am trying to understand how you are going to use this docker image before merge it.

I create the docker image using your Dockerfile and then run it withdocker run image-id, return error exec user process caused "exec format error". (same error with args like docker run image-id --do test d desc), do you have clue how to address this?

my docker version:

Client:
 Version:	17.12.0-ce
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	c97c6d6
 Built:	Wed Dec 27 20:03:51 2017
 OS/Arch:	darwin/amd64

Server:
 Engine:
  Version:	17.12.0-ce
  API version:	1.35 (minimum version 1.12)
  Go version:	go1.9.2
  Git commit:	c97c6d6
  Built:	Wed Dec 27 20:12:29 2017
  OS/Arch:	linux/amd64
  Experimental:	true

Image inspect:

[
    {
        "Id": "sha256:1d83af5fc40c3e16eb6a6ca01ab9d1ce8b8b19b2d941a0a1bb0c89dd46ae9992",
        "RepoTags": [],
        "RepoDigests": [],
        "Parent": "sha256:7fdf476570687240836714364cb374d44466fff016fef832401ffaf8efeea6f3",
        "Comment": "",
        "Created": "2018-05-15T21:04:54.325880197Z",
        "Container": "38fec4983f6c9013dc20a282f26f383411aeccb6b5002b82a375f41075c86ce5",
        "ContainerConfig": {
            "Hostname": "38fec4983f6c",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DEBIAN_FRONTEND=teletype",
                "LANG=en_US.UTF-8",
                "LANGUAGE=en_US:en",
                "LC_ALL=en_US.UTF-8"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "ENTRYPOINT [\"./cadence\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:7fdf476570687240836714364cb374d44466fff016fef832401ffaf8efeea6f3",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "./cadence"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.12.0-ce",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DEBIAN_FRONTEND=teletype",
                "LANG=en_US.UTF-8",
                "LANGUAGE=en_US:en",
                "LC_ALL=en_US.UTF-8"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "sha256:7fdf476570687240836714364cb374d44466fff016fef832401ffaf8efeea6f3",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "./cadence"
            ],
            "OnBuild": [],
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 264386054,
        "VirtualSize": 264386054,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/a320dcc52166f48c7c2bfcb0aaeddb351d777acfd59d778cdae8806ed8d13c2a/diff:/var/lib/docker/overlay2/3758feab9d3285459d98aa163ec0244cea79061c5772e667484d0dc4dbb49f5d/diff:/var/lib/docker/overlay2/26968d14a52086ae050fbb818b6894a01124a5f893d59433ca6dc8ee6bd74143/diff:/var/lib/docker/overlay2/500014014eabe6781baa5c0c4b419c90cc43f7082c52c02cc207efb703044c4f/diff:/var/lib/docker/overlay2/b06ec658e3d4b5449d10fdf40a524f1d0397b72b124e311d707f88f2a053baf0/diff:/var/lib/docker/overlay2/b136a2eb2bea83fea31bd95a7b6b595a2ddd51fa08a2caa6cf23daa251497b40/diff:/var/lib/docker/overlay2/ffc13343241b4c00435a0816a25865810ede0a25c8fe748011bc3b67eb15b0b4/diff:/var/lib/docker/overlay2/b63e5a4eb34c3d7df73ea50f1e752bda272b16a9824dc65bca679ab8fada8d8c/diff",
                "MergedDir": "/var/lib/docker/overlay2/1dc2b754771267996b33ccdbdd70d1b371c1773e1be4ffa39a190cf4decc1f6a/merged",
                "UpperDir": "/var/lib/docker/overlay2/1dc2b754771267996b33ccdbdd70d1b371c1773e1be4ffa39a190cf4decc1f6a/diff",
                "WorkDir": "/var/lib/docker/overlay2/1dc2b754771267996b33ccdbdd70d1b371c1773e1be4ffa39a190cf4decc1f6a/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:a94e0d5a7c404d0e6fa15d8cd4010e69663bd8813b5117fbad71365a73656df9",
                "sha256:88888b9b1b5b7bce5db41267e669e6da63ee95736cb904485f96f29be648bfda",
                "sha256:52f389ea437ebf419d1c9754d0184b57edb45c951666ee86951d9f6afd26035e",
                "sha256:52a7ea2bb533dc2a91614795760a67fb807561e8a588204c4858a300074c082b",
                "sha256:db584c622b50c3b8f9b8b94c270cc5fe235e5f23ec4aacea8ce67a8c16e0fbad",
                "sha256:d8c68e66de785b0c4ea90d5987010e5441ba632855f2d295d51a85c5f1b4d0be",
                "sha256:35b1deeca50879972f7899318b44b8268fed2dac175c542ae231e2297ba31ca9",
                "sha256:01e08c2163d1a5745749a97bde96588610157e091e5d8f0473fe26aac7cd0588",
                "sha256:31c2d138fbef8e140772cdf95ae295e51bc37feb0ba277ee5293ac30a9b8fd1f"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

@ryanwalls
Copy link
Contributor Author

@vancexu Hummm. Try running my built image directly and let me know if you see that error.

docker run --rm ryanwalls/cadence-cli:0.5.3

I'm on this Docker version:

Client:
 Version:      18.05.0-ce-rc1
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   33f00ce
 Built:        Thu Apr 26 00:58:56 2018
 OS/Arch:      darwin/amd64
 Experimental: true
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce-rc1
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   33f00ce
  Built:        Thu Apr 26 01:06:49 2018
  OS/Arch:      linux/amd64
  Experimental: true

As far as how I plan to use it, I'm just going to use this container to run one-off CLI commands as needed. e.g.

docker run --rm -it ryanwalls/cadence-cli:0.5.3 --do qa --ad cadence.default:7933 wf listall

Or if I'm connecting to my kubernetes cluster:

kubectl run tmp-shell --rm -i --tty --restart=Never --image=ryanwalls/cadence-cli:0.5.3 --command -- /bin/bash -c "./cadence --do qa --ad cadence.default:7933 wf listall"

@vancexu
Copy link
Contributor

vancexu commented May 16, 2018

@ryanwalls use your image works as expected. How did you build the image?
I was using docker build -f Dockerfile-cli -t vancexu/cadence-cli:0.5.3 . which return above mentioneds error when run.

@ryanwalls
Copy link
Contributor Author

@vancexu The image was built automatically with Docker hub.

@ryanwalls
Copy link
Contributor Author

@vancexu Were you able to figure out why your local Docker was having trouble? Like I mentioned, it works on my machine and on Docker Hub (where the image was built.)

@vancexu vancexu merged commit 076fb3d into cadence-workflow:master May 29, 2018
@vancexu
Copy link
Contributor

vancexu commented May 29, 2018

@ryanwalls The issue disappeared after I update my docker to latest. Looks good and merged. I will change it a little bit and move it to docker folder later. Thanks again for contribution!

@vancexu
Copy link
Contributor

vancexu commented May 29, 2018

Update a little bit #793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants