Mix release does not build .tar.gz file

Hello! I have a problem with the release building *.tar.gz file. I have followed each step in Deploying with Releases guide on hex.pm, so I can run my app with Docker. I thought everything is going good until the moment of deploying to Docker. Building image stopped at lines where I copy tarball release. I found out there is no .tar.gz file in my release folder.

I assembled another release locally following mentioned above docs but still, there was not any .tar.gz file. Here I attach the files tree:

user@machine my_app % tree -L 2 _build/staging/rel/my_app/releases/
├── 0.1.0
│   ├── consolidated
│   ├── elixir
│   ├── elixir.bat
│   ├── env.bat
│   ├── env.sh
│   ├── iex
│   ├── iex.bat
│   ├── my_app.rel
│   ├── remote.vm.args
│   ├── runtime.exs
│   ├── start.boot
│   ├── start.script
│   ├── start_clean.boot
│   ├── start_clean.script
│   ├── sys.config
│   └── vm.args
└── start_erl.data

Also, I made sure I have steps: [:assemble, :tar] and include_executables_for: [:unix] in mix.exs in release section. I tried with specified path and without specifying it, still no result. Another person, on other machine tried assembling release and the result was the same, no tarball file. We both have gzip and tar installed. On other projects, the tar file is built while assembling release.

Has anyone seen such thing before? I would be grateful for help in finding out what’s wrong in here.

You might show this line…

Anyway, I am not sure why You expect tarball files, it was a thing with distillery, but not with release.

COPY --from=builder /opt/my_app/_build/$APP_ENV/rel/my_app/releases/$VERSION/my_app-$VERSION.tar.gz .

So with release, I do not need tarball file to build the image? Are the release executables that are in my tree file enough? I just started wondering because in other projects, even without distillery, tarball file is created.

I mean, this line would be sufficient to replace the above line?

COPY --from=builder --chown="${USER}":"${USER}" /app/_build/"${APP_ENV}"/rel/my_app ./

If You search in the document You linked for tar.gz, You won’t find anything…

It looks like a docker file for an older Phoenix, using distillery.

I have been using the same release guide, but with alpine image instead of debian.

Did You try?

mix phx.gen.release --docker

Yes, you are right, it is a dockerfile from an older phoenix project. I have not tried it yet but I think I will edit my dockerfile to make it look like the one in the guide and give it a go.