Skip to content

Instantly share code, notes, and snippets.

@frankyston
Last active January 19, 2022 23:28
Show Gist options
  • Save frankyston/cd834a944d9f2abc70c67cfdc0e36abc to your computer and use it in GitHub Desktop.
Save frankyston/cd834a944d9f2abc70c67cfdc0e36abc to your computer and use it in GitHub Desktop.
version: "2"
services:
app:
build:
context: .
dockerfile: ./docker/Dockerfile
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/usr/src/app
expose:
- "3000"
ports:
- 3000:3000
networks:
- my_network
stdin_open: true
tty: true
networks:
- my_network
networks:
my_network:
name: my_network
FROM ruby:2.6.4
RUN apt-get update
RUN apt-get update -qq && apt-get install -y git-core zlib1g-dev build-essential libv8-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libsodium-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs postgresql-client
RUN rm -rf /var/cache/apk/*
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ADD . /usr/src/app
COPY ./.env.local /usr/src/app/
COPY ./.env.test /usr/src/app/
RUN gem install bundler -v 2.2.28
RUN gem install -N libv8 -v '3.16.14.19' -- --with-system-v8 \
&& bundle config --global build.libv8 --with-system-v8
RUN gem install therubyracer -v '0.12.3'
RUN bundle install
[+] Building 26.4s (18/19)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.10kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ruby:2.6.4 1.4s
=> [auth] library/ruby:pull token for registry-1.docker.io 0.0s
=> [ 1/14] FROM docker.io/library/ruby:2.6.4@sha256:403a98dc3cc6737cc81ff5143acb50256ce46a65b462c8c75e1942a1c8480852 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 85.93kB 0.1s
=> CACHED [ 2/14] RUN apt-get update 0.0s
=> CACHED [ 3/14] RUN apt-get update -qq && apt-get install -y git-core zlib1g-dev build-essential libv8-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libsodium-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev 0.0s
=> CACHED [ 6/14] RUN mkdir /usr/src/app 0.0s
=> CACHED [ 7/14] WORKDIR /usr/src/app 0.0s
=> [ 8/14] ADD . /usr/src/app 0.7s
=> [ 9/14] COPY ./.env.local /usr/src/app/ 0.0s
=> [10/14] COPY ./.env.test /usr/src/app/ 0.0s
=> [11/14] RUN gem install bundler -v 2.2.28 6.2s
=> [12/14] RUN gem install -N libv8 -v '3.16.14.19' -- --with-system-v8 && bundle config --global build.libv8 --with-system-v8 10.7s
=> ERROR [13/14] RUN gem install therubyracer -v '0.12.3' 7.2s
------
> [13/14] RUN gem install therubyracer -v '0.12.3':
#18 6.779 Successfully installed ref-2.0.0
#18 6.779 Building native extensions. This could take a while...
#18 7.152 ERROR: Error installing therubyracer:
#18 7.152 ERROR: Failed to build gem native extension.
#18 7.152
#18 7.152 current directory: /usr/local/bundle/gems/therubyracer-0.12.3/ext/v8
#18 7.152 /usr/local/bin/ruby -I /usr/local/lib/ruby/2.6.0 -r ./siteconf20220119-7-1crvmdu.rb extconf.rb
#18 7.152 checking for -lpthread... yes
#18 7.152 checking for v8.h... no
#18 7.152 *** extconf.rb failed ***
#18 7.152 Could not create Makefile due to some reason, probably lack of necessary
#18 7.152 libraries and/or headers. Check the mkmf.log file for more details. You may
#18 7.152 need configuration options.
#18 7.152
#18 7.152 Provided configuration options:
#18 7.152 --with-opt-dir
#18 7.152 --without-opt-dir
#18 7.152 --with-opt-include
#18 7.152 --without-opt-include=${opt-dir}/include
#18 7.152 --with-opt-lib
#18 7.152 --without-opt-lib=${opt-dir}/lib
#18 7.152 --with-make-prog
#18 7.152 --without-make-prog
#18 7.152 --srcdir=.
#18 7.152 --curdir
#18 7.152 --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
#18 7.152 --with-pthreadlib
#18 7.152 --without-pthreadlib
#18 7.152 --enable-debug
#18 7.152 --disable-debug
#18 7.152 --with-v8-dir
#18 7.152 --without-v8-dir
#18 7.152 --with-v8-include
#18 7.152 --without-v8-include=${v8-dir}/include
#18 7.152 --with-v8-lib
#18 7.152 --without-v8-lib=${v8-dir}/lib
#18 7.152 /usr/local/bundle/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
#18 7.152 of V8 found on your system and *not* the one that is bundled with
#18 7.152 the libv8 rubygem.
#18 7.152
#18 7.152 However, your system version of v8 could not be located.
#18 7.152
#18 7.152 Please make sure your system version of v8 that is compatible
#18 7.152 with 3.16.14.19 installed. You may need to use the
#18 7.152 --with-v8-dir option if it is installed in a non-standard location
#18 7.152 from /usr/local/bundle/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
#18 7.152 from extconf.rb:32:in `<main>'
#18 7.152
#18 7.152 To see why this extension failed to compile, please check the mkmf.log which can be found here:
#18 7.152
#18 7.152 /usr/local/bundle/extensions/aarch64-linux/2.6.0/therubyracer-0.12.3/mkmf.log
#18 7.152
#18 7.152 extconf failed, exit code 1
#18 7.152
#18 7.152 Gem files will remain installed in /usr/local/bundle/gems/therubyracer-0.12.3 for inspection.
#18 7.152 Results logged to /usr/local/bundle/extensions/aarch64-linux/2.6.0/therubyracer-0.12.3/gem_make.out
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c gem install therubyracer -v '0.12.3']: exit code: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment