Skip to content

Commit 50dd477

Browse files
committed
Add Dockerfile for reproducing local builds
1 parent c822469 commit 50dd477

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/pkg
2+
/src
3+
/vendor
4+
/Gemfile.lock
5+
*.gem
6+
/Makefile
7+
*.so
8+
*.bundle

Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ARG RUBY_VERSION=2.7
2+
FROM ruby:${RUBY_VERSION}
3+
4+
RUN test ! -f /etc/alpine-release || apk add --no-cache build-base bash python2 python3 git curl tar clang binutils-gold
5+
6+
RUN mkdir -p /code
7+
WORKDIR /code
8+
9+
ARG NODE_VERSION=14.14.0
10+
11+
COPY download-node /code/
12+
RUN ./download-node ${NODE_VERSION}
13+
COPY extract-node /code/
14+
RUN ./extract-node ${NODE_VERSION}
15+
COPY build-libv8 /code/
16+
RUN ./build-libv8 ${NODE_VERSION}
17+
COPY build-monolith /code/
18+
RUN ./build-monolith ${NODE_VERSION}
19+
COPY inject-libv8 /code/
20+
RUN ./inject-libv8 ${NODE_VERSION}
21+
22+
# without this `COPY .git`, we get the following error:
23+
# fatal: not a git repository (or any of the parent directories): .git
24+
# but with it we need the full gem just to compile the extension because
25+
# of gemspec's `git --ls-files`
26+
# COPY .git /code/.git
27+
COPY Gemfile libv8-node.gemspec /code/
28+
COPY lib/libv8/node/version.rb /code/lib/libv8/node/version.rb
29+
RUN bundle install
30+
31+
COPY . /code/
32+
RUN bundle exec rake binary
33+
34+
CMD /bin/bash

0 commit comments

Comments
 (0)