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

Error building latest Docker image on Ubuntu #1535

Open
nexxus-vi opened this issue Nov 7, 2022 · 9 comments
Open

Error building latest Docker image on Ubuntu #1535

nexxus-vi opened this issue Nov 7, 2022 · 9 comments

Comments

@nexxus-vi
Copy link

nexxus-vi commented Nov 7, 2022

  • Errbit version: errbit/errbit:latest
  • OS: ubuntu 16.04.02 LTS

Describe the problem:

I can't build latest Docker image on ubuntu, on macos it works fine. Image before latest can build and run

Steps to reproduce:

  1. Run docker-compose up --build

Observed Results:

  • errbit_1 | bundler: command not found: puma
    errbit_1 | Install missing gem executables with bundle install
    errbit_errbit_1 exited with code 127

Expected Results:

  • Image up

Application Logs:

  • bundler: command not found: puma

errbit:v0.9.0 works fine.

@stevecrozz
Copy link
Member

I don't see an issue yet. Can you grab the latest from github and paste the output of docker build .?

@nexxus-vi nexxus-vi changed the title Errori building latest Docker image on Ubuntu Error building latest Docker image on Ubuntu Nov 7, 2022
@nexxus-vi
Copy link
Author

nexxus-vi commented Nov 7, 2022

Sending build context to Docker daemon  28.01MB
Step 1/16 : FROM ruby:2.7.6-alpine
 ---> 21eeb7e2e13a
Step 2/16 : LABEL maintainer="David Papp <david@ghostmonitor.com>"
 ---> Using cache
 ---> 12865c5c9d1f
Step 3/16 : ENV RUBYGEMS_VERSION=3.3.21
 ---> Using cache
 ---> 7872dfb78055
Step 4/16 : ENV BUNDLER_VERSION=2.3.21
 ---> Using cache
 ---> 92eb1b5d03fa
Step 5/16 : WORKDIR /app
 ---> Using cache
 ---> 745f3041cdae
Step 6/16 : RUN echo "gem: --no-document" >> /etc/gemrc   && bundle config --global frozen 1   && bundle config --global disable_shared_gems false   && gem update --system "$RUBYGEMS_VERSION"   && gem install bundler --version "$BUNDLER_VERSION"   && apk add --no-cache     curl     less     libxml2-dev     libxslt-dev     nodejs     tzdata
 ---> Running in cef1e71b45e1
`/root` is not writable.
Bundler will use `/tmp/bundler20221107-6-anr0nz6' as your home directory temporarily.
`/root` is not writable.
Bundler will use `/tmp/bundler20221107-7-6f93wt7' as your home directory temporarily.
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/bundle directory.
Updating rubygems-update
The command '/bin/sh -c echo "gem: --no-document" >> /etc/gemrc   && bundle config --global frozen 1   && bundle config --global disable_shared_gems false   && gem update --system "$RUBYGEMS_VERSION"   && gem install bundler --version "$BUNDLER_VERSION"   && apk add --no-cache     curl     less     libxml2-dev     libxslt-dev     nodejs     tzdata' returned a non-zero code: 1

@stevecrozz
Copy link
Member

Stange. You can see that it does work as GitHub does the build for us:
https://github.com/errbit/errbit/actions/runs/3252786181/jobs/5339376809

I wonder if there's something about the way your docker daemon is configured. Maybe this test could shed some light. When I run commands against the base image, I am root (within the container), and I am able to write to /root. Are you?

~/d/e/errbit (main)> docker run --rm -it ruby:2.7.6-alpine whoami
root
~/d/e/errbit (main)> docker run --rm -it ruby:2.7.6-alpine touch /root/foo

@nexxus-vi
Copy link
Author

nexxus-vi commented Nov 7, 2022

Yes, it seems like I am (g)root

(base) user@host:~$   docker run --rm -it ruby:2.7.6-alpine whoami
root
(base) user@host:~$  docker run --rm -it ruby:2.7.6-alpine touch /root/foo
(base) user@host:~$

@stevecrozz
Copy link
Member

That's really odd. Right there on step 6, it says /root is not writable. Can you run that specific container and debug it?
docker run --rm -it cef1e71b45e1 sh

From there you should be able to run step 6 manually and hopefully figure out what's up.

@stevecrozz
Copy link
Member

Any ideas + @pigri ?

@nexxus-vi
Copy link
Author

nexxus-vi commented Nov 7, 2022

Nope, that container does not exist. If I try to run the command on the container from step 5 I get the same error /root is not writable... but i can manually write to it!

@stevecrozz
Copy link
Member

Can you break it down to find the first part of the command that gives you an error? It looks like we'll have to debug that in particular

@nexxus-vi
Copy link
Author

nexxus-vi commented Nov 7, 2022

/app # /bin/sh -c echo "gem: --no-document"

/app # /bin/sh -c echo "gem: --no-document" >> /etc/gemrc
/app # /bin/sh -c echo "gem: --no-document" >> /etc/gemrc   && bundle config --global frozen 1
`/root` is not writable.
Bundler will use `/tmp/bundler20221107-8-qvs6hm8' as your home directory temporarily.

Bundle config is the issue

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

No branches or pull requests

2 participants