# How to configure proxy on the user level docker?

**URL:** <https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540>\
**Category:** RancherOS\
**Created:** [September 23, 2015, 6:23pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540 "2015-09-23T18:23:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brucardoso2](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/brucardoso2/32/263_2.png) [@brucardoso2](https://forums.suse.com/u/brucardoso2)\
**Post date:** [September 23, 2015, 6:23pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/1 "2015-09-23T18:23:16Z")

</div>

This is my setup:  
`Windows host -> RancherOS on Virtualbox.`

When trying to add a container to my docker, I get this:

```
[docker@rancher-os ~]$ docker run -d --restart=always -p 8080:8080 rancher/server
Unable to find image 'rancher/server:latest' locally
Pulling repository docker.io/rancher/server
Network timed out while trying to connect to https://index.docker.io/v1/repositories/rancher/server/images. You may want to check your internet connection or if you are behind a proxy.

```

How can I configure the proxy?

(Things that I’ve tried)

- I tried setting up `http_proxy` env var.
- I tried configuring it on `/var/lib/rancher/conf/docker` by appending `export http_proxy=myproxy`

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [September 24, 2015, 4:46pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/2 "2015-09-24T16:46:21Z")

</div>

We lay out the instructions of how to configure Docker to set up a proxy, but overall Rancher needs no special configuration for proxy. You are specifically configuring Docker to work behind a proxy.

[http://docs.rancher.com/rancher/faqs/#how-do-i-run-rancher-and-my-hosts-behind-a-proxy](http://docs.rancher.com/rancher/faqs/#how-do-i-run-rancher-and-my-hosts-behind-a-proxy)

---

<div class="post-metadata">

**Author:** ![brucardoso2](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/brucardoso2/32/263_2.png) [@brucardoso2](https://forums.suse.com/u/brucardoso2)\
**Post date:** [September 24, 2015, 5:14pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/3 "2015-09-24T17:14:13Z")

</div>

Exactly, I just need to configure a proxy on Docker.  
I did this on my linux install, however there is no `/etc/default/docker` on RancherOS, so my question is targeted to how to do it on RancherOS.

I created the /etc/default/docker, but how do I restart the user docker on RancherOS?

---

<div class="post-metadata">

**Author:** ![ibuildthecloud](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ibuildthecloud/32/8_2.png) [@ibuildthecloud](https://forums.suse.com/u/ibuildthecloud)\
**Post date:** [September 24, 2015, 6:17pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/4 "2015-09-24T18:17:26Z")

</div>

If you want to try an RC build of v0.4 this is now possible with by setting in your cloud config the following

```auto
#cloud-config
rancher:
  docker:
    environment:
    - HTTP_PROXY=http://myproxy
    - HTTPS_PROXY=https://myproxy

```

or

`ros config set rancher.docker.environment '[HTTP_PROXY=http://myproxy,HTTPS_PROXY=https://myproxy]'`

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [September 24, 2015, 6:25pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/5 "2015-09-24T18:25:18Z")

</div>

Also, to restart user docker in RancherOS. It should be as simple as restarting a the `docker` container in system-docker. We tested in v0.4.0.

---

<div class="post-metadata">

**Author:** ![brucardoso2](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/brucardoso2/32/263_2.png) [@brucardoso2](https://forums.suse.com/u/brucardoso2)\
**Post date:** [October 7, 2015, 10:56pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/6 "2015-10-07T22:56:04Z")

</div>

Thanks everyone for your responses and sorry for not getting back earlier.

I’m running rancher-os v0.4.0-rc6.

I tried setting the proxy via `ros config...` and verified that my proxy was indeed written to `/var/lib/rancher/conf/cloud-config-local.yml`😉. I also tried restarting the rancher-os vm.

But still, can’t `wget google.com` inside rancher-os… Any other ideas?

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [October 14, 2015, 6:11pm UTC](https://forums.suse.com/t/how-to-configure-proxy-on-the-user-level-docker/540/7 "2015-10-14T18:11:39Z")

</div>

Can you check that when you do a `sudo ros config export -f` that the proxy is set in the `docker` container?
