martins
Hi,
I’m able to run my test from my terminal, but if I’m not able to run the tests from within a container.
I get this error when I run docker compose up:
test-1 | Compiling 50 files (.ex)
test-1 | Generated easy_solutions app
test-1 | ** (exit) exited in: GenServer.call(ExUnit.Server, :modules_loaded, :infinity)
test-1 | ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
test-1 | (elixir 1.14.0) lib/gen_server.ex:1027: GenServer.call/3
test-1 | (ex_unit 1.14.0) lib/ex_unit.ex:376: ExUnit.run/1
test-1 | (mix 1.14.0) lib/mix/compilers/test.ex:42: Mix.Compilers.Test.require_and_run/4
test-1 | (mix 1.14.0) lib/mix/tasks/test.ex:543: Mix.Tasks.Test.do_run/3
test-1 | (mix 1.14.0) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
test-1 | (mix 1.14.0) lib/mix/task.ex:475: Mix.Task.run_alias/6
test-1 | (mix 1.14.0) lib/mix/cli.ex:84: Mix.CLI.run_task/2
I have also tried to replace entrypoint with sleep, so that I can do a docker compose exec test /bin/bash into the container. I can confirm that mix compile works, and I get the same error when I run mix test.
Any suggestions to how I can debug this further?
test.Dockerfile
FROM ubuntu:24.04
ENV MIX_ENV=test
ENV DOCKER_BUILDKIT=1
USER root
RUN apt update
RUN apt install -y erlang-dev elixir erlang-xmerl
RUN apt install -y curl git
RUN useradd -ms /bin/bash appuser
RUN mkdir /app
RUN chown -R appuser /app
USER appuser
COPY . /app
WORKDIR /app
RUN mix local.hex --force
RUN mix local.rebar --force
# install dependencies
COPY mix.exs mix.lock ./
RUN mix deps.get
# compile dependencies
COPY config ./config/
ENTRYPOINT ["mix", "test"]
docker-compose.yaml
version: "3"
services:
test:
environment:
DATABASE_PATH: priv/databases/test.db
SECRET_KEY_BASE: "l7sdfjkhj"
build:
context: .
dockerfile:
test.Dockerfile
volumes:
- ./test_result:/app/test_result
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 4- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
jarlah
I have found this to work previously
martins
Thanks for the suggestion, @jarlah!
Following your advice, I used the Dockerfile generated by
mix phx.gen.release --docker.I added this the the bottom of the Dockerfile:
My docker-compose.yaml looks like this:
Now I can run my tests in a CI/CD pipeline by simply executing
docker compose up testD4no0
Is there a reason you are not using a pre-built docker image for that?
You can find them on dockerhub and hex.
They have erlang and elixir pre-installed and you can select the specific version you need.
martins
Hi @D4no0,
I wasn’t aware of those images.
Thanks for telling me!