Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

app/bin/docker-run not found error on ubuntu arm #62

Open
VESOC opened this issue Sep 11, 2023 · 8 comments
Open

app/bin/docker-run not found error on ubuntu arm #62

VESOC opened this issue Sep 11, 2023 · 8 comments

Comments

@VESOC
Copy link

VESOC commented Sep 11, 2023

I’m trying to selfhost with my vps that’s running the latest ubuntu(on arm) with docker and the following error keeps on happening
IMG_2621

i’m assuming the bin/docker-run is the file its talking about(never used ruby, limited experience in docker)
Tried changing the entrypoint in dockerfile but that failed as well
+my dockerfile and docker-compose.yml

IMG_2622

IMG_2623

@syllver23
Copy link

I had the same issue on ubuntu 18.04
add absolute path to your Dockerfile

ENV PATH="/pathtoyour/container:$PATH"

@mcanyucel
Copy link

mcanyucel commented Feb 11, 2024

I tried to solve this issue by trying around a thousand different approaches and none worked :/ . The Dockerfile is as follows:

from ruby:3.1.2

RUN apt update && apt install -y nodejs

RUN gem update --system
RUN gem install bundler

RUN mkdir /app
WORKDIR /app

EXPOSE 3000

ENTRYPOINT ["/app/bin/docker-run"]

ENV RAILS_SERVE_STATIC_FILES 1
ENV RAILS_LOG_TO_STDOUT 1
ENV PATH="/home/styx/containers/journal/repo/journal:$PATH"

ADD Gemfile Gemfile.lock /app/

RUN bundle update --bundler
RUN bundle install

ADD . .

RUN bundle exec rake assets:precompile

RUN mkdir -p tmp/pids

So what I have tried:

  • added COPY /bin/docker-run /app/bin/docker-run
  • added COPY bin/docker-run /app/bin/docker-run
  • added COPY /home/styx/containers/journal/repo/journal/bin/docker-run /app/bin/docker-run
  • added ADD versions of the commands above.
  • removed ENV PATH and tried the 6 above
  • some silly ways that I am not comfortable confessing here (lol)

Any insights?

Edit: More info.
I see the following line during build using docker-compose.yaml:

 => [journal  2/13] RUN apt update && apt install -y nodejs                                                        8.2s
 => [journal  3/13] RUN gem update --system                                                                        5.3s
 => [journal  4/13] RUN gem install bundler                                                                        1.2s
 => [journal  5/13] RUN mkdir /app                                                                                 0.3s
 => [journal  6/13] WORKDIR /app                                                                                   0.0s
 => [journal  7/13] ADD Gemfile Gemfile.lock /app/                                                                 0.1s
 **=> [journal  8/13] ADD bin/docker-run /app/bin/docker-run**                                                         0.1s
 => [journal  9/13] RUN bundle update --bundler                                                                   85.8s
 => [journal 10/13] RUN bundle install                                                                             0.5s
 => [journal 11/13] ADD . .                                                                                        0.1s
 => [journal 12/13] RUN bundle exec rake assets:precompile                                                         2.2s
 => [journal 13/13] RUN mkdir -p tmp/pids                                                                          0.3s
 => [journal] exporting to image                                                                                   0.8s
 => => exporting layers                                                                                            0.8s
 => => writing image sha256:0d32ff20c9fd3a1a6da55feb71dc9c286f485b97cedad664e7b05808e2ef8ada                       0.0s
 => => naming to docker.io/library/gh-inoda-journal                                                                0.0s
[+] Running 3/1
 ✔ Network journal_proxy           Created                                                                         0.1s
 ✔ Container journal-journal-1     Created                                                                         0.0s
 ✔ Container journal-journal-db-1  Running                                                                         0.0s
Attaching to journal-1, journal-db-1
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/app/bin/docker-run": stat /app/bin/docker-run: no such file or directory: unknown

So the docker-run file is added; but it still fails to find it.

Running sudo docker run --rm -it gh-inoda-journal ls -la /app/bin results in the following output, meaning the file is in the container as an executable:

drwxr-xr-x 1 root root 4096 Feb 11 13:28 .
drwxr-xr-x 1 root root 4096 Feb 11 13:53 ..
-rwxr-xr-x 1 root root  129 Feb 11 12:39 bundle
-rwxr-xr-x 1 root root  564 Feb 11 12:39 docker-run
-rwxr-xr-x 1 root root  141 Feb 11 12:39 rails
-rwxr-xr-x 1 root root   90 Feb 11 12:39 rake
-rwxr-xr-x 1 root root 1008 Feb 11 12:39 setup
-rwxr-xr-x 1 root root  782 Feb 11 12:39 update
sudo docker run --rm -it gh-inoda-journal env

RUBY_MAJOR=3.1
RAILS_LOG_TO_STDOUT=1
HOSTNAME=b7cfbb479047
HOME=/root
BUNDLE_APP_CONFIG=/usr/local/bundle
RUBY_VERSION=3.1.2
TERM=xterm
PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=C.UTF-8
GEM_HOME=/usr/local/bundle
RAILS_ENV=production
RUBY_DOWNLOAD_SHA256=ca10d017f8a1b6d247556622c841fc56b90c03b1803f87198da1e4fd3ec3bf2a
RAILS_SERVE_STATIC_FILES=1
PWD=/app
BUNDLE_SILENCE_ROOT_WARNING=1

If you go docker run -it gh-inoda-journal /bin/bash, you can manually run the docker-run and it returns the following error:

Migrating database...
(in /app)
rake aborted!
ActiveRecord::ConnectionNotEstablished: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_handling.rb:283:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in `each'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
rake:4:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:451:in `exec'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:28:in `start'
/usr/local/bundle/gems/bundler-2.5.6/exe/bundle:28:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.5.6/exe/bundle:20:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'

Caused by:
PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/usr/local/bundle/gems/pg-1.4.5/lib/pg/connection.rb:755:in `connect_start'
/usr/local/bundle/gems/pg-1.4.5/lib/pg/connection.rb:755:in `connect_to_hosts'
/usr/local/bundle/gems/pg-1.4.5/lib/pg/connection.rb:695:in `new'
/usr/local/bundle/gems/pg-1.4.5/lib/pg.rb:69:in `connect'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/connection_handling.rb:283:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in `each'
/usr/local/bundle/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
rake:4:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:451:in `exec'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:28:in `start'
/usr/local/bundle/gems/bundler-2.5.6/exe/bundle:28:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.5.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.5.6/exe/bundle:20:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

@devMaFi
Copy link

devMaFi commented Feb 16, 2024

Hi I forked the project and tried to get the app back running, which was from a perspective of the docker container successful, but not form the aspect of being able to get the whole application up.

As I have no experience with Ruby, no chance for me to solve the missing steps. It seems that due to the version upgrade of Ruby a lot of redesign might be necessary - so I'm out of game.

Nevertheless, the running container setting is available in my repo, feel free to fork!
https://github.com/devMaFi/journal

Be aware, that for testing purpose I disabled the force_ssl in production.rb and disabled the hostbinding in production.rb and development.rb as well.

@svanhoutte
Copy link

I updated the dockerfile and the docker compose on my side. I uploaded also the image on docker hub then there is no need for additional build.
https://github.com/svanhoutte/journal
https://hub.docker.com/repository/docker/svanhoutte/journal/general

Let me know if you face any issues it is working on my side;,
image

@mcanyucel
Copy link

I updated the dockerfile and the docker compose on my side. I uploaded also the image on docker hub then there is no need for additional build. https://github.com/svanhoutte/journal https://hub.docker.com/repository/docker/svanhoutte/journal/general

Let me know if you face any issues it is working on my side;, image

Thanks! It works almost out of the box now using docker compose. The two issues I encountered are:

  • The 'proxy' external network is defined in the compose file, but it is not created. If you create it manually before running the composer, then there is no issue.
  • I don't think the default password is printed to the console, so I had to connect to the container console and use the following commands:
bundle exec rails c
User.create!(username: "...", password: "...")

@svanhoutte
Copy link

The proxy setup is done for Traefik, i updated the documentation in my repo. Then yes it would have to be adapted to what you are using in your environment.
The default password is printed in the console, do a
docker compose logs | grep "Creating initial user"
and you ll see the password as a 33 character string.

@mcanyucel
Copy link

The proxy setup is done for Traefik, i updated the documentation in my repo. Then yes it would have to be adapted to what you are using in your environment. The default password is printed in the console, do a docker compose logs | grep "Creating initial user" and you ll see the password as a 33 character string.

True, I am using containers and caddy for reverse proxy. Thanks for the tip on finding out the password.

@svanhoutte
Copy link

Just updated the docker & gem file to use Alpine:ruby and bump to release 3.3.0, if you want to give it a try. dockerhub tag is svanhoutte/journal:alpine_ruby3.3.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants