# What's the different between rebuild and bootstrap

**URL:** https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315
**Category:** Self-hosting
**Created:** [April 2, 2017, 10:42am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315 "2017-04-02T10:42:51Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![gastrodia](https://avatars.discourse-cdn.com/v4/letter/g/e274bd/32.png) [@gastrodia](https://meta.discourse.org/u/gastrodia)
#### Post date: [April 2, 2017, 10:42am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/1 "2017-04-02T10:42:51Z")

</div>

what’s the different between  
` ./launcher rebuild app ./launcher bootstrap app`  
they both tool slow , is where any command to modify config like UNICORN\_WORKERS and then fast test it

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 2, 2017, 10:46am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/2 "2017-04-02T10:46:54Z")

</div>

> bootstrap: Bootstrap a container for the config based on a template  
> rebuild: Rebuild a container (destroy old, bootstrap, start new)

---

<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: [April 2, 2017, 3:23pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/3 "2017-04-02T15:23:30Z")

</div>

Like @vinothkannans said, they are basically the same. If you want to tweak memory settings, it’ll take 10 minutes to rebuild before you can see if there is a difference.

---

<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: [April 2, 2017, 10:07pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/4 "2017-04-02T22:07:50Z")

</div>

Well, more like [four minutes on a fast machine](https://meta.discourse.org/t/how-much-is-discourse-affected-by-a-faster-cpu/58407/12) 😉

---

<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: [April 2, 2017, 11:43pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/5 "2017-04-02T23:43:02Z")

</div>

Rebuild is a shortcut for the sequence: stop, bootstrap, destroy and then start

If you only need to amend env, do a destroy and then start

---

<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: [April 3, 2017, 2:03am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/6 "2017-04-03T02:03:06Z")

</div>

> [@sam](#):
>
> If you only need to amend env, do a destroy and then start

Oh! That’s news to me. So when `./discourse-setup` is re-run to change email and memory settings, it needs just

```
./launcher destroy app
./launcher start app

```

And only if Let’s Encrypt changes does it need to `./launcher rebuild app`?

Is that right, @sam? If that’s so, @codinghorror, would you like a PR for that?

---

<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: [April 3, 2017, 2:15am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/7 "2017-04-03T02:15:41Z")

</div>

I think that only applies to the variables, not anything that happens to the config as a result of those variables?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [April 3, 2017, 2:19am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/8 "2017-04-03T02:19:12Z")

</div>

There’s not, to my knowledge, any guaranteed delineation between “stuff that gets configured on rebuild” and “stuff that gets configured on container start”. That is, for example at the moment `UNICORN_WORKERS` only gets passed into the container via the environment on boot, however in the future we may need to mangle the container image at build time to apply the setting for some reason.

Taking a quick rummage around, it looks like `LETSENCRYPT_ACCOUNT_EMAIL` does, indeed, get used in the image build process, so a destroy/start cycle after changing that setting in `app.yml` wouldn’t be effective.

---

<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: [April 3, 2017, 1:19pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/9 "2017-04-03T13:19:43Z")

</div>

> [@mpalmer](#):
>
> “stuff that gets configured on container start”.

Just a minor point for other people reading, not for @mpalmer who knows all this stuff 🙂 . Nothing gets configured on container “start”, only on container “create”.

So, for example,

```plaintext
./launcher stop app
./launcher start app

```

Will **not change** anything in the environment.

Stuff gets configured on container creation, which means that there needs to be **no pre-existing container** on the machine when you run `start`

There are indeed ways of using ENV to bootstrap bits of hardcoded data in the container image. However we really should prefer `params` here.

I always found this distinction to be just way to subtle for people to comprehend which is why I always ask people to do `./launcher rebuild` and forget about all the nuance and edge caseyness here.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 21, 2019, 10:57am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/10 "2019-07-21T10:57:19Z")

</div>



---

<div class="post-metadata">

### Author: ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)
#### Post date: [September 28, 2019, 12:31pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/11 "2019-09-28T12:31:44Z")

</div>

> [@sam](#):
>
> Rebuild is a shortcut for the sequence: stop, bootstrap, destroy and then start

Did you mean: stop, destroy… bootstrap, start? (i.e. destroy would come before bootstrapping. Otherwise how would it know which one to delete from 2 stopped containers?)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [September 28, 2019, 10:02pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/12 "2019-09-28T22:02:49Z")

</div>

Destroy can come after bootstrap since the bootstrapped image hasn’t been started as a container yet. So the only container to be destroyed is the one that currently exists in the Stopped state.

I think I explained this to you over the phone as well.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 22, 2023, 10:45pm UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/14 "2023-05-22T22:45:53Z")

</div>



---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 23, 2023, 8:52am UTC](https://meta.discourse.org/t/whats-the-different-between-rebuild-and-bootstrap/60315/15 "2023-05-23T08:52:04Z")

</div>


