# (Re)Installing Discourse with Docker on CentOS 7

**URL:** https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359
**Category:** Self-hosting
**Created:** [June 29, 2017, 8:17pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359 "2017-06-29T20:17:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![c3iq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/c3iq/32/74594_2.png) [@c3iq](https://meta.discourse.org/u/c3iq)
#### Post date: [June 29, 2017, 8:17pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/1 "2017-06-29T20:17:07Z")

</div>

Hello,  
I’m trying to resurrect Discourse on a CentOS 7 VM. It’s been a couple of days and I’ve learnt a lot but…

I keep coming up against the same problem no matter what I try. I have just cleaned up Docker:

```
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
systemctl restart docker
docker rm d509f29962eb
docker rmi $(docker images -q -f dangling=true)
docker rmi $(docker images -q)

```

I removed /var/discourse and re-cloned it:

```
git clone https://github.com/discourse/discourse_docker.git discourse

```

Then ran ./discourse-setup which complained that “DISCOURSE\_SMTP\_USER\_NAME was left blank”

I ran (and get the same result everytime) ./launcher bootstrap app :

[Output from bootstrap](http://c3iq.co.uk/output.txt)

Any ideas what I have missed?

Best regards.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [June 29, 2017, 8:34pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/2 "2017-06-29T20:34:05Z")

</div>

The output from `which` doesn’t look like an issue, that’s just the launcher looking for the right name to use for `docker`, but lines 2, 3, and 4 of that look like trouble.

```plaintext
flag provided but not defined: --format
See 'docker info --help'.
stat: cannot read file system information for ‘/var/lib/docker/aufs’: No such file or directory

```

The version of docker found doesn’t seem to be the one launcher expects. AND you don’t seem to have aufs, which is needed for a working Discourse install.

---

<div class="post-metadata">

### Author: ![c3iq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/c3iq/32/74594_2.png) [@c3iq](https://meta.discourse.org/u/c3iq)
#### Post date: [June 29, 2017, 9:33pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/3 "2017-06-29T21:33:33Z")

</div>

I’m not sure it is aufs. We restored a good backup to another VM and have the service working there. /var/lib/docker/aufs doesn’t exist on that VM. The storage driver on that VM is “devicemapper”. On the copy of the broken production VM (which has other services working on it) I’m trying to setup up Discourse and Docker on a partition with more disk space. That partition was already there and is in use but, I just discovered, is XFS and does not have d\_type set. Strangely, without /etc/docker/daemon.json on the working VM the storage driver is devicemapper by default and on the “broken” VM copy it is overlay. I guess this is because docker knows it’s being written to XFS.

I’ll try reformatting tomorrow.

Thanks.

---

<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: [June 29, 2017, 9:44pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/4 "2017-06-29T21:44:16Z")

</div>

Devicemapper is extremely unstable and a bag of suffering. You _do not_ want devicemapper. The party line is that it “works” on Red Hat OSes but.. we have not found that to be the case.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [June 29, 2017, 9:45pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/5 "2017-06-29T21:45:27Z")

</div>

People have gotten `devicemapper` to work, at least mostly work, but it is not a recommended storage driver and I gather you’ll get mysterious errors.

> [@New installation on Fedora 23 - FAILED RuntimeError: cd /var/www/discourse && su discourse -c](https://meta.discourse.org/t/new-installation-on-fedora-23-failed-runtimeerror-cd-var-www-discourse-su-discourse-c/41220/6):
>
> Devicemapper is non starter, fails spectacularly under load and causes corruption. We block setup if we detect devicemapper. You need aufs or another better supported docker filesystem.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 29, 2017, 10:02pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/6 "2017-06-29T22:02:39Z")

</div>

The first lines show that you are using an old Docker version, can you upgrade to latest? Should be 17.05 or 17.06.

Also, the `chown` command failing indicates a bad file system, which can be devicemapper related.

---

<div class="post-metadata">

### Author: ![c3iq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/c3iq/32/74594_2.png) [@c3iq](https://meta.discourse.org/u/c3iq)
#### Post date: [July 3, 2017, 8:13am UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/7 "2017-07-03T08:13:47Z")

</div>

After I submitted my initial post I was pointed to similar ones. As a result I **re-formatted the bigger disk for XFS with d\_type functionality enabled**. And we put:

```
{
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}

```

in /etc/docker/daemon.json from [https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#configure-docker-with-the-overlay-or-overlay2-storage-driver](https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#configure-docker-with-the-overlay-or-overlay2-storage-driver)

This allowed us to install the container with the base discourse. After we added the socket template we got an error related to Nginx starting up in the container but quickly fixed that. We then restored the Discourse backup and now know how to resurrect the site in production. Thanks for your help.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/re-installing-discourse-with-docker-on-centos-7/65359/8 "2024-06-08T12:44:37Z")

</div>

This topic was automatically closed after 2535 days. New replies are no longer allowed.
