Introduce build2xlsform into ODK Build container, closes #227

This commit is contained in:
Disassembler 2018-03-17 20:49:36 +01:00
parent f436a00223
commit 52557f54aa
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
4 changed files with 43 additions and 6 deletions

View File

@ -2,11 +2,19 @@ FROM ruby
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install runtime dependencies
apk --no-cache add libpq
# Install NodeJS runtime
apk --no-cache add nodejs paxctl \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/bin/node \
# Cleanup
&& apk --no-cache del paxctl
RUN \
# Install build dependencies
# Install runtime dependencies
apk --no-cache add libpq s6
RUN \
# Install build dependencies for ODK Build
apk --no-cache add --virtual .deps build-base git linux-headers openjdk8-jre-base paxctl postgresql-dev \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
@ -26,8 +34,22 @@ RUN \
&& find /srv/odkbuild -name '.git*' -exec rm -rf {} + \
&& rm -rf /root/.bundle
RUN \
# Install build dependencies for build2xlsform
apk --no-cache add --virtual .deps git make \
# Clone build2xlsform
&& git clone --depth 1 https://github.com/opendatakit/build2xlsform /srv/build2xlsform \
&& cd /srv/build2xlsform \
&& make \
# Change ownership
&& chown -R odkbuild:odkbuild /srv/build2xlsform \
# Cleanup
&& apk --no-cache del .deps \
&& find /srv/build2xlsform -name '.git*' -exec rm -rf {} + \
&& rm -rf /root/.config /root/.npm
COPY docker/ /
EXPOSE 8017
USER odkbuild
WORKDIR /srv/odkbuild
CMD ["bundle", "exec", "rackup", "config.ru", "-o", "0.0.0.0", "-p", "8017"]
CMD ["s6-svscan", "/etc/services.d"]

View File

@ -0,0 +1,3 @@
#!/bin/sh
/bin/true

View File

@ -0,0 +1,6 @@
#!/bin/execlineb -P
cd /srv/build2xlsform
fdmove -c 2 1
s6-setuidgid 8017:8017
node lib/server.js

View File

@ -0,0 +1,6 @@
#!/bin/execlineb -P
cd /srv/odkbuild
fdmove -c 2 1
s6-setuidgid 8017:8017
bundle exec rackup config.ru -o 0.0.0.0 -p 8017