# Running Acorn CMDs Inside Docker Container

**URL:** https://discourse.roots.io/t/running-acorn-cmds-inside-docker-container/24085
**Category:** acorn
**Tags:** sage10, acorn
**Created:** 2022-10-17T21:04:28Z
**Posts:** 5

## Post 1 by @neverin772 — 2022-10-17T21:04:28Z

Straight off the bat I’ll admit I’m a total n00b when it comes to docker however at the point I’m a bit lost and I need some help.

I’ve create a docker compose file that spins up WP the DB and the WPCLI. I run my cli commands as such: - `docker-compose run --rm wpcli plugin list` to list the currently installed plugins.

However one issue I’m having is when I run `docker-compose run --rm wpcli acorn help` I get : -

/usr/local/bin/docker-entrypoint.sh: exec: line 11: acorn: not found  
ERROR: 127

I’ve installed Acorn as a plugin but I don’t have a clue how this relates to docker and I’m feeling a bit lost.

Anyone help?

---

## Post 2 by @ben — 2022-10-18T14:23:10Z

Even if Acorn is activated as a plugin it still needs to be booted

[Example from the Sage theme](https://github.com/roots/sage/blob/20f92ebe642fe1b97a35f52bf27b220676f7f6df/functions.php#L20-L43)

---

## Post 3 by @neverin772 — 2022-10-18T17:55:54Z

Thanks for the reply Ben!

Hmmm I’m not sure … I’ve installed acorn via composer and a plugin… just to see if it works and then dumping `var_dump(\Roots\bootloader())` all I get is NULL returned.

I also tested this on a mamp stack and going either the plugin/composer route it works fine it’s just something in docker causing things to totally bork :frowning:

---

## Post 4 by @ben — 2022-10-18T19:23:12Z

Is there a git repo you could push up for us to try out and reproduce?

---

## Post 5 by @rdelbem — 2023-09-17T15:13:47Z

Hopefully, it is not too late to provide an answer.  
I was having the same problem. Basically, we run wp cli in a different container then the server/WordPress. So, whenever wpcli runs it will look up folders that volume, or shared folders between containers. For instance, this is what my wpcli image looks like in my docker-compose.yml:

```
wpcli:
    image: wordpress:cli-php8.1
    volumes:
      - ./custom.ini:/usr/local/etc/php/conf.d/custom.ini
      - ./wp-app:/var/www/html:delegated
      - ./wp-content/themes/:/var/www/html/wp-content/themes:delegated
      - ./wp-content/plugins/:/var/www/html/wp-content/plugins:delegated
      - ./wp-content/uploads/:/var/www/html/wp-content/uploads:cached
    environment:
      VIRTUAL_PORT: 8088
      WORDPRESS_DB_HOST: database:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
    depends_on:
      - database
      - wordpress
```

One other thing to bear in mind is folder and files permissions. One container might have access to one certain folder, but other might not. For that reason check if folders that have been volumed out have read and write access to all. If not `chmod -R 777 ./<folder_name>`.  
Last but not least, certify you have acorn installed by re-running `composer require roots/acorn`.
