Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hasumikin committed May 20, 2022
1 parent f21c195 commit a1e0921
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions Dockerfile
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"]

0 comments on commit a1e0921

Please sign in to comment.