> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# cimg/elixir

An Elixir Docker image built to run on CircleCI that contains a standard erlang and elixir installation

***This image is designed to supercede the legacy CircleCI Elixir image, `circleci/elixir`.***

`cimg/elixir` is a Docker image created by CircleCI with continuous integration builds in mind.
Each tag contains a complete Elixir installation for use with mix and hex.


## Getting Started

This image can be used with the CircleCI `docker` executor.
For example:

```yaml
jobs:
  build:
    docker:
      - image: cimg/elixir:1.19.5-erlang-27.2.2-node
    steps:
      - checkout
      - run: mix --version
      - run: mix deps.get
      - run: mix test
```

In the above example, the CircleCI Elixir Docker image is used as the primary container.
More specifically, the tag `1.19.5-erlang-27.2.2-node` is used meaning the version of elixir will be v1.19.5-erlang-27.2.2-node.
You can now use `mix` within the steps for this job.


## How This Image Works

This image contains both Elixir as well as a supported version of Erlang.

### Tagging Scheme

This image has the following tagging schemes:

Standard scheme will point to the default version of Erlang, which is currently `25.0`
```
cimg/elixir:<elixir-version>[-variant]
```

Optional Erlang version tagging scheme:
```
cimg/elixir:<elixir-version>-<erlang-version>[-variant]
```

`<elixir-version>` - The version of Elixir to use.
This can be a full SemVer point release (such as `1.10.2`) or just the minor release (such as `1.10`).
If you use the minor release tag, it will automatically point to future patch updates as they are released by the Elixir project.
For example, the tag `1.10` points to elixir 1.10.2 now, but when the next release comes out, it will point to 1.10.3.

`<erlang-version>` - The version of Erlang to use.
This will be a major.minor version per Erlang's own naming convention (like `25.0`)

`[-variant]` - Variant tags, if available, can optionally be used.
For example, the Node.js variant can be used like this: `cimg/elixir:1.10.1-node`.

## Image Tags


### Variants

Variant images typically contain the same base software, but with a few additional modifications.

#### Node.js

The Node.js variant is the same Elixir image but with Node.js also installed.
The Node.js variant can be used by appending `-node` to the end of an existing `cimg/elixir` tag.

```yaml
jobs:
  build:
    docker:
      - image: cimg/elixir:1.19.5-erlang-27.2.2-node-node
    steps:
      - checkout
      - run: mix --version
      - run: node --version
```

#### Browsers

The browsers variant is the same Elixir image but with Node.js, Selenium, and browser dependencies pre-installed via apt.
The browsers variant can be used by appending `-browser` to the end of an existing `cimg/elixir` tag.
The browsers variant is designed to work in conjunction with the [CircleCI Browser Tools orb](https://circleci.com/developer/orbs/orb/circleci/browser-tools).
You can use the orb to install a version of Google Chrome and/or Firefox into your build. The image contains all of the supporting tools needed to use both the browser and its driver.

```yaml
orbs:
  browser-tools: circleci/browser-tools@1.1
jobs:
  build:
    docker:
      - image: cimg/elixir:1.11-browsers
    steps:
      - browser-tools/install-browser-tools
      - checkout
      - run: |
          mix --version
          node --version
          java --version
          google-chrome --version
```
