# Suporte para rodar em Apple M1

**URL:** <https://meta.discourse.org/t/support-for-running-on-apple-m1/229724>\
**Category:** Feature\
**Created:** [Junho 12, 2022, 4:31pm UTC](https://meta.discourse.org/t/support-for-running-on-apple-m1/229724 "2022-06-12T16:31:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![titusc](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@titusc](https://meta.discourse.org/u/titusc)\
**Post date:** [Junho 12, 2022, 4:31pm UTC](https://meta.discourse.org/t/support-for-running-on-apple-m1/229724/1 "2022-06-12T16:31:33Z")

</div>

Olá, estou usando o M1 para desenvolver automação e ferramentas para colocar o Discourse em funcionamento. O script discourse-setup tem um problema ao reconhecer CPUs baseadas em ARM e falha com o seguinte erro. Isso resultou no contêiner não iniciando. No meu caso, estou optando pela abordagem de contêiner web + dados, então é o contêiner web que falha ao iniciar.

```plaintext
./discourse-setup: line 261: *0: syntax error: operand expected (error token is \"*0\")

```

Aparentemente, isso se deve ao script suportar apenas a saída de CPUs baseadas em Intel em /proc/cpuinfo, e o processador baseado em ARM é diferente. Um exemplo pode ser visto em [`/proc/cpuinfo` inside containers reports meaningless data on Apple M1 Max · Issue #6111 · docker/for-mac · GitHub](https://github.com/docker/for-mac/issues/6111)

O seguinte PR tenta resolver isso usando lscpu em vez disso.  
[FEATURE: Updated avail\_cores calculation to handle Apple M1 or ARM processors by cheungtitus · Pull Request #631 · discourse/discourse\_docker (github.com)](https://github.com/discourse/discourse_docker/pull/631)

**Saída Completa**

```plaintext
./discourse-setup --two-container
The configuration file containers/web_only.yml already exists!

. . . reconfiguring . . .

Saving old file as web_only.yml.2022-06-12-062509.bak
Stopping existing container in 5 seconds or Control-C to cancel.
WARNING: Support for aarch64 is experimental at the moment. Please report any problems at https://meta.discourse.org/tag/arm
Press any key to continue
WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

aarch64: Pulling from discourse/base
Digest: sha256:a2ce381fdc4fed59fe160fb01b79bce0d5266f59ad907a22f3399772c8711791
Status: Image is up to date for discourse/base:aarch64
docker.io/discourse/base:aarch64
WARNING: containers/web_only.yml file is world-readable. You can secure this file by running: chmod o-rwx containers/web_only.yml
web_only was not started !
./discourse-doctor may help diagnose the problem.

./discourse-setup: line 261: *0: syntax error: operand expected (error token is \"*0\")

Hostname for your Discourse? [discourse.example.com]:

```

---

_[View the full topic](https://meta.discourse.org/t/support-for-running-on-apple-m1/229724)._
