Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment.md #99

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions guides/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@ For example:
heroku buildpacks:add -i 1 https://github.com/emk/heroku-buildpack-rust.git
echo "RUST_SKIP_BUILD=1" > RustConfig
```

### Deploying with Docker

Make sure rust is installed prior to running `mix deps.compile`. You can see examples of what commands to include in your Dockerfile by looking at the official rust Dockerfiles. For example, here are the commands for [`alpine3.11`](https://github.com/rust-lang/docker-rust/blob/009cc0a821ff773d54875350312731ed490d5cce/1.43.1/alpine3.11/Dockerfile) based images.

If your Dockerfile is separated into a `build stage` and a `release stage` rust only needs to be installed during the build phase. **However**, your image will need to have `libcc` installed during the `release stage`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libgcc, not libcc


Copy link
Owner

@mischov mischov Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add something like

"For example, Alpine does not have libgcc installed by default, so it needs to be added with: "

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay!! I just noticed! Thank you for fixing and improving the PR!!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem, thank you for figuring this out and writing it up in the first place.

```
RUN apk add --no-cache libgcc
```

You will also need to have the folloing environment variable set during the `build` stage or else `mix compile` will fail.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"following", not "folloing"


```
RUSTFLAGS='--codegen target-feature=-crt-static'
```