-
Notifications
You must be signed in to change notification settings - Fork 39
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
Running d2vm behind proxy #5
Comments
I don't know. I have no experience with running behind proxy. |
From the docker documentation : the proxy is configurable on the Docker client side. |
This config file will be useful to run or create a docker container. But for building dockerfile behind proxy I have to add http_proxy variable in the dockerfile. Or I have to pass --build-arg option while building but I see that while with convert we cannot pass any --build-arg option. |
You are right, the convert command does not support build flags. As written in the docker documentation:
I don't think that using the old method is what you want as it makes the image less portable. Have you tried to configure the docker client ? |
Yes it is already configured in my ~/.docker/config.json file. But as I said earlier this will not be passed while building dockerfile. This will be passed during create or run container. As written in docker documentation:
|
Oops, sorry... the links are for the docker client... the Dockerfile build steps are executed by the daemon so you need to configure the docker daemon to use the proxy: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy |
This proxies are configured is my docker daemon. Now here is my observation:
My /tmp folder is having 777 permission.
So, if you can address this permission denied issue, proxy related issue can be avoided. |
It is Since the proxy configuration works without sudo, you may need to duplicate your docker client proxy configuration for the root user in |
All permissions are granted to
For proxy I am not allowed to duplicate those docker config for root user. |
The problem is not the binary permissions, it is the operation performed by |
How to address that? |
Can you try: alias d2vm='docker run --rm -i -t --privileged -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/build -w /build -v $HOME/.docker:/root/.docker linkacloud/d2vm:v0.0.6-19e3a69' Then run the convert command ?
All commands in the documentation (except --help) are executed with sudo. |
I tried but same problem 'permission denied'. |
Did you launch the > alias d2vm='docker run --rm -i -t --privileged -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/build -w /build -v $HOME/.docker:/root/.docker linkacloud/d2vm:v0.0.6-19e3a69'
> which d2vm
d2vm: aliased to docker run --rm -i -t --privileged -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/build -w /build -v $HOME/.docker:/root/.docker linkacloud/d2vm:v0.0.6-19e3a69
> d2vm convert --debug (# the rest of the command) |
Yes. But for me
|
can you move the binary out of your |
Ok now it is facing proxy issue. (not running with sudo) |
ok, can you retry but with the docker > alias d2vm='docker run --rm -i -t --privileged --user=$UID -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/build -w /build -v $HOME/.docker:/root/.docker linkacloud/d2vm:v0.0.6-19e3a69'
> which d2vm
d2vm: aliased to docker run --rm -i -t --privileged --user=$UID -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/build -w /build -v $HOME/.docker:/root/.docker linkacloud/d2vm:v0.0.6-19e3a69
> d2vm convert --debug (# the rest of the command)
|
Got an error
|
... of course... sorry about that one. I have one last idea: # remove the alias
> unalias d2vm
# restore the `d2vm` binary
> cp ~/go/bin/d2vm.bak ~/go/bin/d2vm
# validate d2vm command
> which d2vm
/home/user/go/bin/d2vm
# and retry with 'sudo' but with environment preservation:
> sudo -E d2vm convert ... |
Ohh....yes!! this works. Thank you so much for your awesome support @Adphi. Appreciate your efforts. |
@sanketIntel You're welcome. |
set user permissions on image if run with sudo or in docker run/vbox & run/hetzner: run qemu-img in docker if not available in path Signed-off-by: Adphi <[email protected]>
My system is behind proxy and it fails to convert image, so I added http_proxy and https_proxy in ubuntu.Dockerfile to make it work.
Is there any other way to make it work?
The text was updated successfully, but these errors were encountered: