gem compiler

This commit is contained in:
f 2019-09-18 10:18:01 -03:00
parent a2e27c5316
commit e7fe5ab5b8
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 33 additions and 1 deletions

View file

@ -1,2 +1,21 @@
FROM sutty/monit:latest FROM sutty/sdk-ruby:latest
MAINTAINER "f <f@sutty.nl>" MAINTAINER "f <f@sutty.nl>"
ENV GEM=none
ENV VERSION=0
ENV SUTTY=sutty.nl
ENV HTTP_BASIC_USER=sutty
ENV HTTP_BASIC_PASSWORD=gibberish
COPY ./gem-compiler.gem /tmp/
RUN gem install --no-user-install --no-document /tmp/gem-compiler.gem
RUN gem install --no-user-install --no-document --source https://rubygems.org geminabox
COPY ./gemcompiler.sh /usr/local/bin/gemcompiler
RUN chmod 755 /usr/local/bin/gemcompiler
RUN install -dm 2750 -o builder -g builder /srv/gems
VOLUME /srv/gems
USER builder
ENTRYPOINT /usr/local/bin/gemcompiler

BIN
gem-compiler.gem Normal file

Binary file not shown.

13
gemcompiler.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
cd /srv/gems
test -f ${GEM}-${VERSION}.gem \
|| gem fetch --source=https://rubygems.org --platform=ruby \
--version ${VERSION} ${GEM}
test -f ${GEM}-${VERSION}-`uname -m`-linux.gem \
|| gem compile -V --prune ${GEM}-${VERSION}.gem
gem inabox ${GEM}-${VERSION}-`uname -m`-linux.gem \
--host https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@gems.${SUTTY}