superruzafa

superruzafa

Hi, this is the first time I migrated the release system for a distributed app from Distillery to Elixir releases.

I’m building a docker image containing the release but when I launch it I’m getting this error:

=ERROR REPORT==== 16-Aug-2023::14:04:26.370926 ===
Failed to create cookie file '/.erlang.cookie': eacces
=CRASH REPORT==== 16-Aug-2023::14:04:26.377384 ===

I tried to create a writable /.erlang.cookie file with some contents but it didn’t work.

Creating a release in the past with just Elixir releases has not been a problem, but this time I don’t know how to fix this error.

Showing Posts 1 to 6

dimitarvp

dimitarvp

Can you show us your Docker file? The error you’re getting is basically “access denied, can’t create file” basically, btw.

superruzafa

superruzafa OP

Sure, but I wonder if the cookie path can be somehow changed in vm.args.

FROM alpine:latest

RUN mkdir -p /app && chown -R nobody: /app
# By doing this the app doesn't boot, it complains about the owner of the file
# RUN touch /.erlang.cookie && chmod 600 /.erlang.cookie

WORKDIR /app
USER nobody

COPY --chown=nobody:nobody _build/prod/rel/my_app .

ENV REPLACE_OS_VARS=true
ENV HTTP_PORT=4291 BEAM_PORT=14291 ERL_EPMD_PORT=24291

EXPOSE $HTTP_PORT $BEAM_PORT $ERL_EPMD_PORT
ENTRYPOINT ["/app/bin/my_app"]
dimitarvp

dimitarvp

Not sure about the file – you can probably create it outside of Docker and jitsu mount it as a volume?

Or, according to docker-ejabberd/ecs at master · processone/docker-ejabberd · GitHub you can also just set the ERLANG_COOKIE environment variable (inside the container I mean).

ndrean

ndrean

Isn’t it RELEASE_COOKIE cf mix release — Mix v1.20.2 ?

or even set it in the Mix.Project.project releases I believe

dimitarvp

dimitarvp

Could be, I was looking at the Erlang config.

superruzafa

superruzafa OP

It seems that the Erlang restringes the location of the erlang.cookie file, it will be created in the $HOME directory.

What happened is that $HOME was set to /

Once I changed it in the Dockerfile, the file could be created and the app booted!

ENV HOME=/app

Thanks you all guys!

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews