2018-03-16 18:31:34 +01:00
|
|
|
FROM ruby
|
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
RUN \
|
|
|
|
# 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
|
|
|
|
|
2018-03-16 18:31:34 +01:00
|
|
|
RUN \
|
|
|
|
# Install runtime dependencies
|
2018-03-17 20:49:36 +01:00
|
|
|
apk --no-cache add libpq s6
|
2018-03-16 18:31:34 +01:00
|
|
|
|
|
|
|
RUN \
|
2018-03-17 20:49:36 +01:00
|
|
|
# Install build dependencies for ODK Build
|
2018-03-16 18:31:34 +01:00
|
|
|
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 \
|
|
|
|
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
|
|
|
|
# Clone ODK Build
|
|
|
|
&& git clone --depth 1 https://github.com/opendatakit/build /srv/odkbuild \
|
|
|
|
# Install Ruby dependencies
|
|
|
|
&& cd /srv/odkbuild \
|
|
|
|
&& bundle install --without test \
|
|
|
|
&& rake deploy:build \
|
|
|
|
# Create OS user
|
2018-03-17 16:13:16 +01:00
|
|
|
&& addgroup -S -g 8017 odkbuild \
|
|
|
|
&& adduser -S -u 8017 -h /srv/odkbuild -s /bin/false -g odkbuild -G odkbuild odkbuild \
|
2018-03-16 18:31:34 +01:00
|
|
|
&& chown -R odkbuild:odkbuild /srv/odkbuild \
|
|
|
|
# Cleanup
|
|
|
|
&& apk --no-cache del .deps \
|
|
|
|
&& find /srv/odkbuild -name '.git*' -exec rm -rf {} + \
|
|
|
|
&& rm -rf /root/.bundle
|
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
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/ /
|
|
|
|
|
2018-03-17 16:13:16 +01:00
|
|
|
EXPOSE 8017
|
2018-03-16 18:31:34 +01:00
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
CMD ["s6-svscan", "/etc/services.d"]
|