# './launcher bootstrap app' fails when Docker started with '--userns-remap=default' option

**URL:** <https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566>\
**Category:** Self-hosting\
**Created:** [2016年十一月6日 02:29 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566 "2016-11-06T02:29:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://meta.discourse.org/u/Rob_T)\
**Post date:** [2016年十一月6日 02:29 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/1 "2016-11-06T02:29:33Z")

</div>

Docker version 1.12.3, build 6b644ec

The ‘shared’ subdirectory seems to cause issues when Docker started with ‘–userns-remap=default’.

First error was ‘stat /var/discourse/shared/standalone: permission denied’  
I then executed ‘chmod 0755 shared’ which seemed to fix this issue.

Next error was at ‘mkdir -p /shared/postgres\_run’ - I assume its another ‘permission denied’ but couldn’t figure out how to get past it.

‘stat shared’ returns:

File: ‘shared’  
Size: 4096 Blocks: 8 IO Block: 4096 directory  
Device: fd04h/64772d Inode: 256072 Links: 3  
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)  
Context: unconfined\_u:object\_r:svirt\_sandbox\_file\_t:s0  
Access: 2016-11-05 08:07:06.081247227 -0500  
Modify: 2016-11-05 08:09:20.368153861 -0500  
Change: 2016-11-05 21:22:19.291492841 -0500  
Birth: -

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2016年十一月6日 04:31 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/2 "2016-11-06T04:31:25Z")

</div>

Why do you need this command line option?

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://meta.discourse.org/u/Rob_T)\
**Post date:** [2016年十一月6日 06:25 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/3 "2016-11-06T06:25:56Z")

</div>

We’ve avoided using LXC and Docker on our servers up until now due to the necessity to run these processes as root.

When I saw that Docker now supports ‘User Namespaces’ which address these concerns I thought I’d test Docker + Discourse, since Discourse does look useful.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2016年十一月7日 02:49 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/4 "2016-11-07T02:49:41Z")

</div>

If you are going down this rabbit hole you are going to have to test and debug this stuff yourself and get super familiar with docker and the way we bootstrap images.

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://meta.discourse.org/u/Rob_T)\
**Post date:** [2016年十一月7日 07:15 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/5 "2016-11-07T07:15:27Z")

</div>

Thanks for your prompt responses.  
We’ll fall back to testing on an Amazon instance using the traditional settings.

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://meta.discourse.org/u/Rob_T)\
**Post date:** [2016年十一月25日 09:01 UTC](https://meta.discourse.org/t/launcher-bootstrap-app-fails-when-docker-started-with-userns-remap-default-option/52566/6 "2016-11-25T09:01:26Z")

</div>

I got discourse to work when Docker started with --userrns-remap=default.

In my case docker allocated UID 100000 and GID 100000 to root within the discourse container.

To get bootstrap to succeed I needed to set group and ownership on the discourse shared directory correctly:

sudo chown -R 100000:100000 /var/discouse/shared  
sudo chown 0711 /var/discouse/shared

It needs to be said that the recursive chown command should only be run once before first bootstrapping.
