# VM Crashing with tini Error: “No such file or directory” - What am I missing?

**URL:** <https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624>\
**Category:** Questions / Help\
**Tags:** containers, login-only\
**Created:** [April 18, 2025, 8:23pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624 "2025-04-18T20:23:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiler](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Spiler](https://community.fly.io/u/Spiler)\
**Post date:** [April 18, 2025, 8:23pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/1 "2025-04-18T20:23:30Z")

</div>

Hey all, I’m running into a persistent issue when deploying my app on [Fly.io](http://Fly.io). The VM boots up, mounts the volume fine, but crashes shortly after with the following error:

`ERROR Error: failed to spawn command: tini -- /usr/local/bin/my_init --no-main-command: No such file or directory (os error 2)`

It also asks:

`does `tini` exist and is it executable?`

This seems to happen right after:

`INFO Preparing to run: `tini – /usr/local/bin/my\_init --no-main-command` as root`

And then the machine exits abruptly and doesn’t restart.

I’m not sure if I’ve missed something super basic here. The app worked locally in Docker, but I’m new to Fly and might’ve misconfigured something.

Thanks in advance for any insight!

---

<div class="post-metadata">

**Author:** ![halfer](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@halfer](https://community.fly.io/u/halfer)\
**Post date:** [April 20, 2025, 12:21pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/2 "2025-04-20T12:21:41Z")

</div>

> [@Spiler](#):
>
> I’m not sure if I’ve missed something super basic here.

Yep. Showing us your Dockerfile 😉

---

<div class="post-metadata">

**Author:** ![Spiler](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Spiler](https://community.fly.io/u/Spiler)\
**Post date:** [April 20, 2025, 4:27pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/3 "2025-04-20T16:27:47Z")

</div>

Sure thing, here’s the Dockerfile:

```auto
# syntax=docker/dockerfile:1

#
# MariaDB dependencies build step
#
FROM mariadb:lts-noble AS mariadb

#
# Built-in docs build step
#
FROM ghcr.io/azuracast/azuracast.com:builtin@sha256:9e072d46f8c0425518a673bdf3271b3ecfe5550a5561d4c723fcc6dc10f5b78f AS docs

#
# Icecast-KH with AzuraCast customizations build step
#
FROM ghcr.io/azuracast/icecast-kh-ac:2024-02-13 AS icecast

#
# PHP Extension Installer build step
#
FROM mlocati/php-extension-installer AS php-extension-installer

# ---

FROM scratch AS dependencies

# Add PHP extension installer tool
COPY --from=php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

# Add MariaDB dependencies
COPY --from=mariadb /usr/local/bin/healthcheck.sh /usr/local/bin/db_healthcheck.sh
COPY --from=mariadb /usr/local/bin/docker-entrypoint.sh /usr/local/bin/db_entrypoint.sh

# Add Icecast
COPY --from=icecast /usr/local/bin/icecast /usr/local/bin/icecast
COPY --from=icecast /usr/local/share/icecast /usr/local/share/icecast

#
# Final build image
#
FROM php:8.4-fpm-bookworm AS pre-final

ENV TZ="UTC" \
    LANGUAGE="en_US.UTF-8" \
    LC_ALL="en_US.UTF-8" \
    LANG="en_US.UTF-8" \
    LC_TYPE="en_US.UTF-8"

COPY --link --from=dependencies / /

# Run base build process
RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    bash /bd_build/prepare.sh && \
    bash /bd_build/add_user.sh && \
    bash /bd_build/cleanup.sh

# Build each set of dependencies in their own step for cacheability.
RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    --mount=type=bind,source=./util/docker/supervisor,target=/bd_build/supervisor,rw \
    bash /bd_build/supervisor/setup.sh && \
    bash /bd_build/cleanup.sh

RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    --mount=type=bind,source=./util/docker/stations,target=/bd_build/stations,rw \
    bash /bd_build/stations/setup.sh && \
    bash /bd_build/cleanup.sh

RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    --mount=type=bind,source=./util/docker/web,target=/bd_build/web,rw \
    bash /bd_build/web/setup.sh && \
    bash /bd_build/cleanup.sh

RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    --mount=type=bind,source=./util/docker/mariadb,target=/bd_build/mariadb,rw \
    bash /bd_build/mariadb/setup.sh && \
    bash /bd_build/cleanup.sh

RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    --mount=type=bind,source=./util/docker/redis,target=/bd_build/redis,rw \
    bash /bd_build/redis/setup.sh && \
    bash /bd_build/cleanup.sh

RUN --mount=type=bind,source=./util/docker/common,target=/bd_build,rw \
    bash /bd_build/chown_dirs.sh

# Add built-in docs
COPY --from=docs --chown=azuracast:azuracast /dist /var/azuracast/docs

USER azuracast

RUN touch /var/azuracast/.docker

USER root

VOLUME "/var/azuracast/stations"
VOLUME "/var/azuracast/backups"
VOLUME "/var/lib/mysql"
VOLUME "/var/azuracast/storage/acme"
VOLUME "/var/azuracast/storage/geoip"
VOLUME "/var/azuracast/storage/rsas"
VOLUME "/var/azuracast/storage/sftpgo"
VOLUME "/var/azuracast/storage/shoutcast2"
VOLUME "/var/azuracast/storage/stereo_tool"
VOLUME "/var/azuracast/storage/uploads"

EXPOSE 80 443 2022
EXPOSE 8000-8999

# Sensible default environment variables.
ENV LANG="en_US.UTF-8" \
    PATH="${PATH}:/var/azuracast/storage/shoutcast2" \
    APPLICATION_ENV="production" \
    MYSQL_HOST="localhost" \
    MYSQL_PORT=3306 \
    MYSQL_USER="azuracast" \
    MYSQL_PASSWORD="(redacted for forum post)" \
    MYSQL_DATABASE="azuracast" \
    ENABLE_REDIS="true" \
    REDIS_HOST="localhost" \
    REDIS_PORT=6379 \
    REDIS_DB=0 \
    NGINX_RADIO_PORTS="default" \
    NGINX_WEBDJ_PORTS="default" \
    COMPOSER_PLUGIN_MODE="false" \
    ADDITIONAL_MEDIA_SYNC_WORKER_COUNT=0 \
    PROFILING_EXTENSION_ENABLED=0 \
    PROFILING_EXTENSION_ALWAYS_ON=0 \
    PROFILING_EXTENSION_HTTP_KEY=dev \
    PROFILING_EXTENSION_HTTP_IP_WHITELIST=* \
    ENABLE_WEB_UPDATER="true"

#
# Development Build
#
FROM pre-final AS development

# Dev build step
COPY ./util/docker/common /bd_build/
COPY ./util/docker/dev /bd_build/dev

RUN bash /bd_build/dev/setup.sh \
    && bash /bd_build/cleanup.sh \
    && rm -rf /bd_build

USER azuracast

WORKDIR /var/azuracast/www

COPY --chown=azuracast:azuracast . .

RUN composer install --no-ansi --no-interaction \
    && composer clear-cache

RUN npm ci --include=dev \
    && npm cache clean --force

USER root

# Sensible default environment variables.
ENV APPLICATION_ENV="development" \
    PROFILING_EXTENSION_ENABLED=1 \
    ENABLE_WEB_UPDATER="false"

# Entrypoint and default command
ENTRYPOINT ["tini", "--", "/usr/local/bin/my_init"]
CMD ["--no-main-command"]

#
# Final build (Just environment vars and squishing the FS)
#
FROM pre-final AS final

USER azuracast

WORKDIR /var/azuracast/www

COPY --chown=azuracast:azuracast . .

RUN composer install --no-dev --no-ansi --no-autoloader --no-interaction \
    && composer dump-autoload --optimize --classmap-authoritative \
    && composer clear-cache

USER root

# Entrypoint and default command
ENTRYPOINT ["tini", "--", "/usr/local/bin/my_init"]
CMD ["--no-main-command"]

```

Appreciate the help!

---

<div class="post-metadata">

**Author:** ![halfer](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@halfer](https://community.fly.io/u/halfer)\
**Post date:** [April 20, 2025, 9:53pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/4 "2025-04-20T21:53:14Z")

</div>

Righto. I think you’re bumping into this problem:

> [@Is it possible to use my own \`/init\` ?](https://community.fly.io/t/is-it-possible-to-use-my-own-init/12082):
>
> I wan´t to start more than one service inside a single machine, and would like to use some kind of supervisor. I already tried the s6-overlay, but it doesn’t work since I’m using ENTRYPOINT ["/init"] on my Dockerfile and it conflicts with the firecracker /init (I suppose). What are my options? I [already reached s6-overlay](https://github.com/just-containers/s6-overlay/issues/522) about making it work bellow another PID1, but couldn’t. Also tried runit, and calling like this: ENTRYPOINT ["runsvdir"] CMD ["/etc/services.d/"] kind of work, but I …

You’re trying to use your own init process, but the Firecracker VMs are set to use their own anyway, and I wonder if there is a conflict. Set up your Docker image without one, and let Fly handle that stuff.

---

<div class="post-metadata">

**Author:** ![Spiler](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Spiler](https://community.fly.io/u/Spiler)\
**Post date:** [April 25, 2025, 7:13pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/5 "2025-04-25T19:13:29Z")

</div>

Sorry for the really late reply!

It turns out I was using the official AzuraCast image, which already includes its own init process. I tried modifying it to avoid using one, but unfortunately, it still didn’t work — maybe I just messed something up, because I am fairly new to this.  
For now, I think I’ll try migrating to another platform to see if I have better luck there.

Thanks again for your tips and your willingness to help — I really appreciate it!

---

<div class="post-metadata">

**Author:** ![halfer](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@halfer](https://community.fly.io/u/halfer)\
**Post date:** [April 25, 2025, 11:40pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/6 "2025-04-25T23:40:51Z")

</div>

No worries. If you want pure Docker, AWS Fargate may suit you. It’s more expensive, but I think it’d be absolutely rock solid.

---

<div class="post-metadata">

**Author:** ![rubys](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rubys/32/16907_2.png) [@rubys](https://community.fly.io/u/rubys)\
**Post date:** [April 26, 2025, 3:49am UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/7 "2025-04-26T03:49:21Z")

</div>

I missed this, but you should now be able to use your own init with [containers](https://community.fly.io/t/docker-without-docker-now-with-containers/22903).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [May 8, 2025, 9:35pm UTC](https://community.fly.io/t/vm-crashing-with-tini-error-no-such-file-or-directory-what-am-i-missing/24624/9 "2025-05-08T21:35:33Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
