docker-archive / dockercloud-cli

CLI for Docker Cloud
https://cloud.docker.com/
Apache License 2.0
74 stars 40 forks source link

Can't access any local files #58

Open mjdavies opened 6 years ago

mjdavies commented 6 years ago

docker-cloud -v docker-cloud 1.0.9

Hi there.

I'm using the technique of running docker-cloud on a container on my mac.

Here's my alias in my .bash_profile

alias docker-cloud="docker run -it -e DOCKERCLOUD_USER=username -e DOCKERCLOUD_PASS=passwrod -e DOCKERCLOUD_NAMESPACE=orgname --rm dockercloud/cli"

It's been working fine, but now I can't seem to access any local files, like this.

docker-cloud stack update stackname -f stackfile.yml

It keeps saying [Errno 2] No such file or directory whenever I try to point it at a local file.

It works fine for everything else.

I understand that the file isn't in the docker container OS, so it can't fine it, but wondering if you have a solution to this?

I saw this option on your help page

alias docker-cloud="docker run -it -v ~/.docker:/root/.docker:ro --rm dockercloud/cli"

That looks like it's trying to mount volumes and files, but when I edit my alias to include the -v options I then get this error.

dockercloud.api.exceptions.AuthError: error getting credentials - err: exec: "docker-credential-osxkeychain": executable file not found in $PATH, out: ``

I'm obviously doing something wrong, if anyone can point me in the right direction I'd be extremely grateful.

tifayuki commented 6 years ago

@mjdavies you can try to mount your stack file to the container.

alias docker-cloud="docker run -it -e DOCKERCLOUD_USER=username -e DOCKERCLOUD_PASS=passwrod -e DOCKERCLOUD_NAMESPACE=orgname -v $(pwd)/stackfile.yml:/stackfile.yml --rm dockercloud/cli"

Then run `docker-cloud stack update stackname -f /stackfile.yml

mjdavies commented 6 years ago

Hi @tifayuki

Thanks for getting back to me.

I tried doing that, but unfortunately it doesn't work, same error.

Could be down to permissions?

Surely this isn't that hard, I must be doing something wrong, otherwise docker cloud wouldn't advertise this as a standard way of using docker cloud cli? Would they?

tifayuki commented 6 years ago

@mjdavies I tested personally and it works fine on my side

$ ls
stackfile.yml

$ alias docker-cloud="docker run -it -e DOCKERCLOUD_USER=xxxx -e DOCKERCLOUD_PASS=xxxx -v $(pwd)/stackfile.yml:/stackfile.yml --rm dockercloud/cli"

$ docker-cloud stack create -f /stackfile.yml -n test
b60b422b-db68-4fa6-9fe2-4d496f1ad05e

$ docker-cloud stack update test -f /stackfile.yml
b60b422b-db68-4fa6-9fe2-4d496f1ad05e