-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
from ruby:2.7.2-slim | ||
from ruby:3.0.0-slim | ||
|
||
RUN apt update && apt -y upgrade | ||
RUN apt install -y bison make git gcc gcc-arm-linux-gnueabi qemu qemu-kvm qemu-system-arm | ||
RUN apt install -y \ | ||
bison \ | ||
gcc \ | ||
gcc-arm-linux-gnueabi \ | ||
git \ | ||
make \ | ||
qemu \ | ||
qemu-kvm \ | ||
qemu-system-arm | ||
|
||
RUN gem update --system | ||
|
||
RUN git clone https://github.com/mruby/mruby /root/mruby | ||
ARG MRUBY_TAG | ||
RUN cd /root/mruby; git checkout $MRUBY_TAG; make | ||
ARG USER_ID | ||
RUN useradd -m -u $USER_ID mrubyc | ||
RUN mkdir /work && chown mrubyc /work | ||
|
||
USER mrubyc | ||
|
||
VOLUME /root/mrubyc | ||
COPY Gemfile /root/mrubyc/ | ||
COPY Gemfile.lock /root/mrubyc/ | ||
WORKDIR /root/mrubyc | ||
VOLUME /work/mrubyc | ||
COPY --chown=mrubyc Gemfile /work/mrubyc/ | ||
COPY --chown=mrubyc Gemfile.lock /work/mrubyc/ | ||
|
||
USER root | ||
WORKDIR /work/mrubyc | ||
RUN bundle install | ||
|
||
USER mrubyc | ||
ENV CFLAGS="-DMRBC_USE_MATH=1 -DMAX_SYMBOLS_COUNT=500" | ||
CMD ["bundle", "exec", "mrubyc-test", "-e", "100", "-p", "/root/mruby/build/host/bin/mrbc"] | ||
|
||
RUN git clone https://github.com/mruby/mruby /work/mruby | ||
ARG MRUBY_TAG | ||
RUN cd /work/mruby; git fetch --prune; git checkout $MRUBY_TAG; make clean && make | ||
|
||
CMD ["bundle", "exec", "mrubyc-test", "-e", "10", "-p", "/work/mruby/build/host/bin/mrbc"] |