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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews