Rails on Resin - server side builds work but local ones don't?



Okay so this is potentially a bit complex but I’ll try and explain everything as best I can.

I have a multicontainer project which is Ruby on Rails based. Here’s the Dockerfile

FROM arm32v7/ruby:2.5.0
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev libssl-dev nodejs
RUN mkdir /plink
WORKDIR /plink
COPY Gemfile /plink/Gemfile
COPY Gemfile.lock /plink/Gemfile.lock
RUN bundle install
COPY . /plink
CMD puma -C config/puma.rb

The db container uses an image (arm32v6/postgres:9.6-alpine) as does Redis (arm32v6/redis:4.0-alpine).

Here’s the deal. When I start the Dockerfile with a normal Ruby image ruby:2.5.0 and run docker-compose up --build everything works superbly on my Mac. The arm32 versions of postgres and redis run fine.

If I switch to the arm32v7 version of Ruby, everything builds fine, but when trying to load the first page (this is locally on my Mac) I get the following error:

! Unable to load application: PG::ConnectionBad: could not translate host name "db" to address: No address associated with hostname

Now, here’s the odd bit. If I push the exact same commit I’m trying to build locally to Resin (and let Resin build it server side) when it all downloads to my Pi it works perfectly. The biggest issue I have is that I can’t have a half decent local development workflow. Because when I run it in local mode, my laptop is responsible for building the image that gets sent to the Pi. And that image gets the same error when running on my machine or my Pi.

I’m a little bit stuck here though. I’ve got pretty far running everything in the first place, but I don’t really know enough to understand what could be going wrong here and how to begin debugging this. So any pointers would be very much appreciated! Also if you need to see more files from the project I can upload them.



Some additional information I’ve noticed. Step 8 of the process runs bundle install. A few gems say Installing <gem-name> with native extensions in the log. After each of these, I get a red line saying qemu: Unsupported syscall: 391

The thing that stood out to me was the pg gem (which is the postgres interface) results in the same issue. I think this has something to do with it, so going to do some further reading on that.