# Docker\_dev image broken for users other than UID 1000

**URL:** https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694
**Category:** Development
**Created:** [10월 9, 2017, 5:18오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694 "2017-10-09T17:18:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 9, 2017, 5:18오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/1 "2017-10-09T17:18:28Z")

</div>

I saw recently that the docker\_dev image had been updated, and I was hoping that would solve the problems I’ve been having, but there’s some kind of permissions error:

```plaintext
Migrating database...
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - tmp
/src/config/boot.rb:16:in `<top (required)>'
/src/config/application.rb:1:in `require'
/src/config/application.rb:1:in `<top (required)>'
/src/Rakefile:5:in `require'
/src/Rakefile:5:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - tmp
/src/config/boot.rb:16:in `<top (required)>'
/src/config/application.rb:1:in `require'
/src/config/application.rb:1:in `<top (required)>'
/src/Rakefile:5:in `require'
/src/Rakefile:5:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
Creating admin user...
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - tmp
/src/config/boot.rb:16:in `<top (required)>'
/src/config/application.rb:1:in `require'
/src/config/application.rb:1:in `<top (required)>'
/src/Rakefile:5:in `require'
/src/Rakefile:5:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

```

I’ve been trying to run an importer in a production environment and have been getting similar errors, that seem to have to do with not being able to create TMP files, which I can’t make sense of.

Edit: Well, darn. It worked just fine on my development machine, but not on the customer’s machine where I’m trying to use it.

Edit: Somehow `./discourse/tmp` doesn’t exist and the script is getting run as some user other than root.

---

<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: [10월 9, 2017, 8:53오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/2 "2017-10-09T20:53:44Z")

</div>

I would not really call this a bug, it is a dev issue, the docker dev environment expects the user to be the first user that was created on the machine

We can improve this possibly with the uid mapping stuff docker has now, but it is tricky

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 9, 2017, 8:58오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/3 "2017-10-09T20:58:44Z")

</div>

> [@sam](#):
>
> the docker dev environment expects the user to be the first user that was created on the machine

Thanks, @sam. That’s **very** helpful and explains a bunch of stuff that I could previously explain only by the possible existence of demons. I feel somewhat less like I’m going crazy now.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 9, 2017, 10:36오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/4 "2017-10-09T22:36:32Z")

</div>

I lost more hours on this than I care to admit. It worked fine on my machine, but wouldn’t work where I was trying to make it work (trying to set up an environment where a client could painlessly re-run an import). docker\_dev seems like a great way for a Normal Person to be able to run an importer.

> [@sam](#):
>
> the docker dev environment expects the user to be the first user that was created on the machine

Darn. It’s not quite the “first user” as I just added a user on a Digital Ocean droplet (their image has no normal user); I added a user, added that user to the docker group and tried to run `boot_dev` as that user and got the same permission error.

> [@sam](#):
>
> We can improve this possibly with the uid mapping stuff docker has now, but it is tricky

I was hoping that this would a good-enough test and error message to add to `boot_dev`, but it isn’t. Is there some simple test?

```plaintext

if ["$UID" != 1000]
then
    echo "discourse_dev expects to be run by first user (UID 1000)."
    exit 1
fi

```

This is getting far afield from the OP, I was hoping too that docker\_dev might be a solution to my “what if I need to run a couple imports and do development on something else all at the same time” problem, but it’s not quite that yet.

---

<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: [10월 9, 2017, 11:04오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/5 "2017-10-09T23:04:07Z")

</div>

Erroring out is probably the best “first thing” to do.

Longer term on boot it can re-chown everything to the correct user id or something.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 9, 2017, 11:05오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/6 "2017-10-09T23:05:48Z")

</div>

> [@sam](#):
>
> Erroring out is probably the best “first thing” to do.

Agreed. I can’t figure out what the test should be or what the definition of “first user” is.

---

<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: [10월 9, 2017, 11:07오후 UTC](https://meta.discourse.org/t/docker-dev-image-broken-for-users-other-than-uid-1000/71694/7 "2017-10-09T23:07:10Z")

</div>

You need to look a the owner user id of the files mounted via the volume.
