Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image build issues #6

Open
pandaboy6621 opened this issue Feb 1, 2025 · 11 comments
Open

Docker image build issues #6

pandaboy6621 opened this issue Feb 1, 2025 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@pandaboy6621
Copy link

I am trying to build the docker image and get this error. How do i fix this? Are there any plans to make a prebuilt image so this can be run easily in docker compose without us needing ti build the image?

[+] Building 3.0s (11/11) FINISHED                                                                    docker:default
 => [internal] load build definition from Dockerfile                                                            0.0s
 => => transferring dockerfile: 768B                                                                            0.0s
 => [internal] load metadata for docker.io/library/ruby:slim                                                    0.4s
 => [internal] load .dockerignore                                                                               0.0s
 => => transferring context: 2B                                                                                 0.0s
 => [1/7] FROM docker.io/library/ruby:slim@sha256:5007f131f506bdd87b73e0169999ebf7241f239909a7542634a8fecb33c5  0.0s
 => [internal] load build context                                                                               0.0s
 => => transferring context: 3.50kB                                                                             0.0s
 => CACHED [2/7] RUN apt-get update &&     apt-get install -y --no-install-recommends     build-essential       0.0s
 => CACHED [3/7] WORKDIR /app                                                                                   0.0s
 => CACHED [4/7] COPY Gemfile Gemfile.lock ./                                                                   0.0s
 => CACHED [5/7] RUN bundle install                                                                             0.0s
 => CACHED [6/7] COPY . .                                                                                       0.0s
 => ERROR [7/7] RUN bundle exec rake db:setup                                                                   2.5s
------                                                                                                               
 > [7/7] RUN bundle exec rake db:setup:                                                                              
2.441 connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory           
2.441 	Is the server running locally and accepting connections on that socket?
2.441 Couldn't create 'trmnl_byos_sinatra' database. Please check your configuration.
2.441 rake aborted!
2.441 ActiveRecord::ConnectionNotEstablished: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (ActiveRecord::ConnectionNotEstablished)
2.441 	Is the server running locally and accepting connections on that socket?
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:61:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new_client'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:934:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#connect'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:946:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#reconnect'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:669:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
2.441 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:668:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:770:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
2.441 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:761:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:778:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#connect!'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:984:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
2.441 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:983:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
2.441 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1129:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:46:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#create_database'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/postgresql_database_tasks.rb:23:in 'ActiveRecord::Tasks::PostgreSQLDatabaseTasks#create'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:117:in 'ActiveRecord::Tasks::DatabaseTasks#create'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:171:in 'block in ActiveRecord::Tasks::DatabaseTasks#create_current'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:587:in 'block (2 levels) in ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:584:in 'Array#each'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:584:in 'block in ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:595:in 'Array#each'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:595:in 'ActiveRecord::Tasks::DatabaseTasks#each_current_environment'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:583:in 'ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:171:in 'ActiveRecord::Tasks::DatabaseTasks#create_current'
2.441 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/railties/databases.rake:46:in 'block (2 levels) in <top (required)>'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in 'Kernel.load'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in 'Bundler::CLI::Exec#kernel_load'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:451:in 'Bundler::CLI#exec'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor.rb:527:in 'Bundler::Thor.dispatch'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:34:in 'Bundler::CLI.dispatch'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:28:in 'Bundler::CLI.start'
2.441 /usr/local/bundle/gems/bundler-2.5.6/exe/bundle:28:in 'block in <top (required)>'
2.441 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
2.441 /usr/local/bundle/gems/bundler-2.5.6/exe/bundle:20:in '<top (required)>'
2.441 /usr/local/bundle/bin/bundle:25:in 'Kernel#load'
2.441 /usr/local/bundle/bin/bundle:25:in '<main>'
2.441 
2.441 Caused by:
2.441 PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (PG::ConnectionBad)
2.441 	Is the server running locally and accepting connections on that socket?
2.442 /usr/local/bundle/gems/pg-1.5.9/lib/pg/connection.rb:837:in 'PG::Connection.connect_start'
2.442 /usr/local/bundle/gems/pg-1.5.9/lib/pg/connection.rb:837:in 'PG::Connection.connect_to_hosts'
2.442 /usr/local/bundle/gems/pg-1.5.9/lib/pg/connection.rb:772:in 'PG::Connection.new'
2.442 /usr/local/bundle/gems/pg-1.5.9/lib/pg.rb:63:in 'PG.connect'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:58:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new_client'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:934:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#connect'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:946:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#reconnect'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:669:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
2.442 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:668:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:770:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
2.442 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:761:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:778:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#connect!'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:984:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
2.442 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:983:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
2.442 /usr/local/bundle/gems/activesupport-8.0.0.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:1129:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:46:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#create_database'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/postgresql_database_tasks.rb:23:in 'ActiveRecord::Tasks::PostgreSQLDatabaseTasks#create'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:117:in 'ActiveRecord::Tasks::DatabaseTasks#create'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:171:in 'block in ActiveRecord::Tasks::DatabaseTasks#create_current'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:587:in 'block (2 levels) in ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:584:in 'Array#each'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:584:in 'block in ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:595:in 'Array#each'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:595:in 'ActiveRecord::Tasks::DatabaseTasks#each_current_environment'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:583:in 'ActiveRecord::Tasks::DatabaseTasks#each_current_configuration'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/tasks/database_tasks.rb:171:in 'ActiveRecord::Tasks::DatabaseTasks#create_current'
2.442 /usr/local/bundle/gems/activerecord-8.0.0.1/lib/active_record/railties/databases.rake:46:in 'block (2 levels) in <top (required)>'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in 'Kernel.load'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:58:in 'Bundler::CLI::Exec#kernel_load'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:451:in 'Bundler::CLI#exec'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor.rb:527:in 'Bundler::Thor.dispatch'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:34:in 'Bundler::CLI.dispatch'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/cli.rb:28:in 'Bundler::CLI.start'
2.442 /usr/local/bundle/gems/bundler-2.5.6/exe/bundle:28:in 'block in <top (required)>'
2.442 /usr/local/bundle/gems/bundler-2.5.6/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
2.442 /usr/local/bundle/gems/bundler-2.5.6/exe/bundle:20:in '<top (required)>'
2.442 /usr/local/bundle/bin/bundle:25:in 'Kernel#load'
2.442 /usr/local/bundle/bin/bundle:25:in '<main>'
2.442 Tasks: TOP => db:setup => db:create
2.442 (See full trace by running task with --trace)
------
Dockerfile:29
--------------------
  27 |     COPY . .
  28 |     
  29 | >>> RUN bundle exec rake db:setup 
  30 |     
  31 |     # Expose the port that the application will run on
--------------------
ERROR: failed to solve: process "/bin/sh -c bundle exec rake db:setup" did not complete successfully: exit code: 1```
@pprazzi
Copy link

pprazzi commented Feb 1, 2025

Try to uncomment this line in the Dockerfile and see if this helps

# Uncomment the next line to switch to sqlite
#ENV BYOS_DATABASE=sqlite

@pandaboy6621
Copy link
Author

Looks like that fixed it, Are there any plans to publish the image to run this container with docker compose?

@adrianleh
Copy link

@pandaboy6621 I wrote a docker-compose.yml for that'll handle local build. Might be of use

version: '3.8'

services:
  trmnl:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: trmnl
    ports:
      - "4567:4567"
    env_file:
      - .env

@pandaboy6621
Copy link
Author

pandaboy6621 commented Feb 10, 2025 via email

@bkuhlmann bkuhlmann self-assigned this Feb 18, 2025
@bkuhlmann bkuhlmann added the bug Something isn't working label Feb 18, 2025
@bkuhlmann
Copy link
Member

Hey Aidan. 👋 Could you trying using the new bin/docker/build script. Once you pull from master. I've made building the docker image easier with the new script.

@pandaboy6621
Copy link
Author

I will try it now and report back

@pandaboy6621
Copy link
Author

Hey Aidan. 👋 Could you trying using the new bin/docker/build script. Once you pull from master. I've made building the docker image easier with the new script.

Looks like the script sucessfully built the image. How can i specify that built image via a docker compose yaml file?

@pandaboy6621
Copy link
Author

I tried using this

version: "3.8"

services:
  trmnl:
    image: byos_sinatra
    container_name: trmnl
    ports:
      - "4567:4567"
    env_file:
      - .env

networks: {}

And it gave me an trmnl exited with code 0 error

Here is the output of the build script

[+] Building 1.5s (20/20) FINISHED                                                       docker:default
 => [internal] load build definition from Dockerfile                                               0.0s
 => => transferring dockerfile: 1.22kB                                                             0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.4                        0.7s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                   0.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112f  0.0s
 => [internal] load .dockerignore                                                                  0.0s
 => => transferring context: 314B                                                                  0.0s
 => [internal] load metadata for docker.io/library/ruby:3.4.2-slim                                 0.5s
 => [auth] library/ruby:pull token for registry-1.docker.io                                        0.0s
 => [base 1/3] FROM docker.io/library/ruby:3.4.2-slim@sha256:2864c6bfcf8fec6aecbdbf5bd7adcb8abe93  0.0s
 => [internal] load build context                                                                  0.0s
 => => transferring context: 2.60kB                                                                0.0s
 => CACHED [base 2/3] WORKDIR /app                                                                 0.0s
 => CACHED [base 3/3] RUN <<STEPS (apt-get update -qq ...)                                         0.0s
 => CACHED [build 1/4] RUN <<STEPS (apt-get update -qq ...)                                        0.0s
 => CACHED [build 2/4] COPY .ruby-version Gemfile Gemfile.lock ./                                  0.0s
 => CACHED [build 3/4] RUN <<STEPS (bundle install...)                                             0.0s
 => CACHED [build 4/4] COPY . .                                                                    0.0s
 => CACHED [stage-2 1/4] COPY --from=build /usr/local/bundle /usr/local/bundle                     0.0s
 => CACHED [stage-2 2/4] COPY --from=build /app /app                                               0.0s
 => CACHED [stage-2 3/4] RUN <<STEPS (mkdir -p /app/log...)                                        0.0s
 => CACHED [stage-2 4/4] RUN groupadd --system --gid 1000 app &&     useradd app --uid 1000 --gid  0.0s
 => exporting to image                                                                             0.0s
 => => exporting layers                                                                            0.0s
 => => writing image sha256:281dea80ced05c671bcd96691d0aab8f68089ee782002174dda85c5481a34893       0.0s
 => => naming to docker.io/library/byos_sinatra:latest   

And here are my images

aidan@Server-1:~/byos_sinatra$ docker images | grep byos_sinatra
byos_sinatra                                     latest           281dea80ced0   33 minutes ago   211MB
aidan@Server-1:~/byos_sinatra$ 

@pandaboy6621
Copy link
Author

Are there any needed values that I have to input into the env? Also I currently don't have the sqlite option added as mentioned here. i can't even find it as a comment to begin with.

Try to uncomment this line in the Dockerfile and see if this helps

# Uncomment the next line to switch to sqlite
#ENV BYOS_DATABASE=sqlite

@amorton12
Copy link

The container this builds is a little unusual, in that it doesn't have a default entrypoint that runs the server or something continuously - the default entrypoint just runs whatever you pass in as a command argument (ref the bin/docker/console script to see it running bash in interactive mode). This works fine if you understand what is going on and how to work with it, but it is a departure from the more common behavior in docker containers for services like this. I think the assumption is that the container's entrypoint will run the service (mine certainly was at first).

@pandaboy6621 If you want to "hold" the container open, so to speak, you need to give it something to do forever. You can add
command: tail -f /dev/null to your compose file if you want it to hang out for you to use docker exec to pop a shell and run/test the server code manually, but it's probably best to use it in the prescribed way (interactively, using the script in bin/docker) in its current form.

@bkuhlmann
Copy link
Member

[The Dockerfile] doesn't have a default entrypoint

ℹ️ This'll soon be resolved in this code review when it lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants