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

Fix the building of docker image #574

Closed
wants to merge 2 commits into from
Closed

Fix the building of docker image #574

wants to merge 2 commits into from

Conversation

vitkabele
Copy link

Fixes #523.
Building Docker image was failing due to the outdated ruby base image. Updated to ruby:latest.

@vitkabele vitkabele changed the title Fix the building of docker image [WIP] Fix the building of docker image Jun 5, 2021
@vitkabele vitkabele changed the title [WIP] Fix the building of docker image Fix the building of docker image Jun 5, 2021
@vitkabele
Copy link
Author

This should also fix the automated container build.

Copy link
Collaborator

@mockdeep mockdeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this @vitkabele! A couple of minor comments, but looks pretty good!

Dockerfile Outdated
@@ -7,7 +7,7 @@ EXPOSE 8080

WORKDIR /app
ADD Gemfile Gemfile.lock /app/
RUN bundle install --deployment
RUN bundle config set --local deployment 'true' && bundle install
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the quotes around 'true' here. All CLI arguments get passed through as strings to Ruby.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it could. This is what the bundler itself told me that is the preferred way :).

Dockerfile Outdated
@@ -36,7 +36,7 @@ ADD docker/start.sh /app/
ADD . /app

RUN useradd -m stringer
RUN chown -R stringer:stringer /app
RUN chown -R stringer:stringer /app /etc/supervisord.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell me more about why this was necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise the supervisord is failing with error "Cannot read /etc/supervisord.conf"

@vitkabele vitkabele changed the title Fix the building of docker image [WIP] Fix the building of docker image Jun 6, 2021
@vitkabele
Copy link
Author

vitkabele commented Jun 6, 2021

Sadly all attempts to run the container ends with:


2021-06-06 10:48:39,502 DEBG 'unicorn' stdout output:

2021-06-06 10:48:39 - ActiveRecord::RecordNotFound - Couldn't find User with 'id'=1:

	/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/core.rb:155:in `find'
	/app/app/repositories/user_repository.rb:7:in `fetch'
	/app/app/helpers/authentication_helpers.rb:20:in `current_user'
	app/views/layout.erb:22:in `block in singleton class'
	app/views/layout.erb:-5:in `instance_eval'
	app/views/layout.erb:-5:in `singleton class'
	app/views/layout.erb:-7:in `__tilt_14856460'
	...
	/usr/local/bin/bundle:22:in `load'
	/usr/local/bin/bundle:22:in `<main>'

Any ideas? The problem is clearly with initial user creation, but I don't have time to solve it now. This is WIP until resolved.

EDIT: Everything works after the user is created manually. And this problem also happens on the official image from hub.docker.com

@vitkabele
Copy link
Author

Should work now. Please check

@vitkabele vitkabele changed the title [WIP] Fix the building of docker image Fix the building of docker image Jun 6, 2021
@mockdeep mockdeep deleted the branch stringer-rss:master January 10, 2022 03:18
@mockdeep mockdeep closed this Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Docker image
2 participants