https://github.com/geeks-solutions/elixir_rust
https://github.com/geeks-solutions/elixir_rust
dockerfile elixir nif rust
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/geeks-solutions/elixir_rust
- Owner: Geeks-Solutions
- Created: 2021-02-16T11:03:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-09-24T07:30:56.000Z (9 months ago)
- Last Synced: 2025-09-24T09:35:39.663Z (9 months ago)
- Topics: dockerfile, elixir, nif, rust
- Language: Dockerfile
- Homepage: https://hub.docker.com/repository/docker/geeks5olutions/elixir_rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elixir Rust Docker Image
This repo hosts the Dockerfile to produce an image that is based on Alpine, includes Elixir and Rust (with Cargo).
It is used in a CI pipeline to run code standard right away, with no before_script requirements:
`mix credo --strict`
to run tests:
`mix coveralls`
And also to build a production ready Elixir release.
Adding Rust to this image allows to compile Rust Nifs based on Rustler.
If a release relies on a Rust NIFs, then your release env. should contain libgcc. For instance here is a working example:
```Dockerfile
FROM alpine:3.13 AS app
RUN apk add --no-cache openssl ncurses-libs libgcc
WORKDIR /app
RUN chown nobody:nobody /app
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel ./
ENV HOME=/app
COPY entrypoint.sh .
# Run the Phoenix app
CMD ["./entrypoint.sh"]
```
## Development
If you want to contribute you can update the versions necessary and then build for multiple plateforms:
```bash
docker buildx build . --platform linux/amd64,linux/arm64 -t geeks5olutions/elixir_rust:{tag}
```
To debug you can add the following parameters to the above command:
`--progress=plain --no-cache`
To push to the registry run the buildx command with the `--push` param