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

Issues inside docker #46

Closed
kpayson opened this issue May 13, 2021 · 2 comments
Closed

Issues inside docker #46

kpayson opened this issue May 13, 2021 · 2 comments

Comments

@kpayson
Copy link
Contributor

kpayson commented May 13, 2021

I'm having trouble with using restish inside a docker container.

My dockerfile creates a user 'cli-user', unzips the restish code into /user/local/bin and adds an apis.json and api spc in the /home/cli-user/.restish folder

when I run my container as the cli-user, and run restish list I see this error:
**_panic: open /home/cli-user/.restish/cache.json: permission denied

goroutine 1 [running]:
github.com/danielgtaylor/restish/cli.initCache(0xd3f496, 0x7)
/home/runner/work/restish/restish/cli/cli.go:393 +0x483
github.com/danielgtaylor/restish/cli.Init(0xd3f496, 0x7, 0xf28444, 0x5)
/home/runner/work/restish/restish/cli/cli.go:101 +0x73
main.main()
/home/runner/work/restish/restish/main.go:14 +0x52_**

when I run my container as an admin and run restish list I get this error:
Caught error: Get "https://list": dial tcp: lookup list on 192.168.65.1:53: no such host

Please let me know what I can do to fix these issues. What permissions is 'cli-user missing'?

What is trying to be done on 192.168.65.1:53 ?? Do I need to make changes to my docker network

@kpayson
Copy link
Contributor Author

kpayson commented May 17, 2021

I fixed the permission error with a simple chmod on the .restish folder.

The latest is that when I try run inside of a docker container, the -H flag to pass the access token doesn't seem to be working.
For example this command works for me out side of docker and I get a list of client records:

restish a-ci -H "Authorization: bearer eyJhbGciOiJ…” tenant-client-controller-find 1

but when I run it inside my container, I am prompted to log in:

`Open your browser to log in using the URL:
https://a-ci.labshare.org/_api/auth/ls/authorize?audience=https%3A%2F%2Fa-ci.labshare.org%2F_api%2Fauth%2Fls&client_id=auth-ui2&code_challenge=cQEM37t-W79EcUEla8hrsOSZZw4v0TFZzED7Zdhlby8&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A8484%2F&response_type=code&scope=openid+profile+email
Alternatively, enter the code manually:

Unable to get a code. See browser for details. Aborting!
`

Any theory about how the docker envonment could be effecting the processing of the bearer token ?

@kpayson
Copy link
Contributor Author

kpayson commented May 17, 2021

Found the issue - the latest published build (0.7) does not have the fix for the -H issue. Also needed to make sure docker had a linux x86 build and not my local osx build

@kpayson kpayson closed this as completed May 17, 2021
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

No branches or pull requests

1 participant