From 6bc570a7d6626eaf65fa718d3d364f77b85322a5 Mon Sep 17 00:00:00 2001 From: Charlie Allom Date: Sat, 10 Feb 2018 20:41:28 +0000 Subject: fix: Fixed docker build (#1181) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 49ebb6e..e72a449 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER Samer Abdel-Hafez RUN add-apt-repository ppa:brightbox/ruby-ng && \ apt-get update && \ - apt-get install -y ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++ + apt-get install -y ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++ libffi-dev RUN mkdir -p /tmp/oxidized COPY . /tmp/oxidized/ -- cgit v1.2.1 From 04c61e0a5cf4ee21158cbc5d827682bda525f82a Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sun, 11 Mar 2018 22:21:04 +0100 Subject: Refresh Dockerfile Refresh Dockerfile to resolve multiple issues: * Bump base image from 0.9.18 to 0.10.0 (now xenial based). * Remove dependency on ppa:brightbox and use xenial ruby2.3 * Split build into 2 stages to backport libssh2 1.7.0 which is needed for githubrepo hook but is not available in xenial * Misc cleanup and comments --- Dockerfile | 56 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index e72a449..36c650c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,38 @@ -FROM phusion/baseimage:0.9.18 -MAINTAINER Samer Abdel-Hafez - -RUN add-apt-repository ppa:brightbox/ruby-ng && \ - apt-get update && \ - apt-get install -y ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++ libffi-dev - -RUN mkdir -p /tmp/oxidized +# -- stage 1: backport libssh2 1.7.0 from zesty for xenial, as githubrepo hook requires it +FROM ubuntu:xenial as libssh2-backport + +# set up dependencies for the build process +RUN apt-get -yq update && \ + apt-get -yq install build-essential chrpath debhelper dh-autoreconf libgcrypt20-dev zlib1g-dev + +# build libssh2 1.7.0 +WORKDIR /tmp/libssh2-build +ADD https://launchpad.net/ubuntu/+archive/primary/+files/libssh2_1.7.0-1ubuntu1.debian.tar.xz . +ADD https://launchpad.net/ubuntu/+archive/primary/+files/libssh2_1.7.0.orig.tar.gz . +RUN tar xvf libssh2_1.7.0.orig.tar.gz +WORKDIR /tmp/libssh2-build/libssh2-1.7.0 +RUN tar xvf ../libssh2_1.7.0-1ubuntu1.debian.tar.xz + +WORKDIR /tmp/libssh2-build/libssh2-1.7.0 +ENV DEB_BUILD_OPTIONS nocheck +RUN dpkg-buildpackage -b + +# -- stage 2: build the actual oxidized container +FROM phusion/baseimage:0.10.0 +LABEL maintainer="Samer Abdel-Hafez " + +# set up dependencies for the build process +RUN apt-get -yq update && \ + apt-get -yq install ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++ libffi-dev + +# upgrade libssh2 to self-built backport from stage 1 +COPY --from=libssh2-backport \ + /tmp/libssh2-build/libssh2-1_1.7.0-1ubuntu1_amd64.deb \ + /tmp/libssh2-build/libssh2-1-dev_1.7.0-1ubuntu1_amd64.deb \ + /tmp/ +RUN dpkg -i /tmp/*.deb + +# build and install oxidized COPY . /tmp/oxidized/ WORKDIR /tmp/oxidized @@ -16,16 +43,15 @@ RUN gem install oxidized-*.gem RUN gem install oxidized-web --no-ri --no-rdoc # dependencies for hooks -RUN gem install aws-sdk -RUN gem install slack-api -RUN gem install xmpp4r +RUN gem install aws-sdk slack-api xmpp4r +# clean up +WORKDIR / RUN rm -rf /tmp/oxidized +RUN rm /tmp/*.deb +RUN apt-get -yq --purge autoremove ruby-dev pkg-config make cmake -RUN apt-get remove -y ruby-dev pkg-config make cmake - -RUN apt-get -y autoremove - +# add runit services ADD extra/oxidized.runit /etc/service/oxidized/run ADD extra/auto-reload-config.runit /etc/service/auto-reload-config/run ADD extra/update-ca-certificates.runit /etc/service/update-ca-certificates/run -- cgit v1.2.1 From cd466cc2d11c276f125d909b3196553570666537 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Fri, 6 Apr 2018 20:51:10 +0200 Subject: reorder dockerfile gem installation --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 36c650c..07adc0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,9 @@ COPY --from=libssh2-backport \ /tmp/ RUN dpkg -i /tmp/*.deb +# dependencies for hooks +RUN gem install aws-sdk slack-api xmpp4r + # build and install oxidized COPY . /tmp/oxidized/ WORKDIR /tmp/oxidized @@ -42,9 +45,6 @@ RUN gem install oxidized-*.gem # web interface RUN gem install oxidized-web --no-ri --no-rdoc -# dependencies for hooks -RUN gem install aws-sdk slack-api xmpp4r - # clean up WORKDIR / RUN rm -rf /tmp/oxidized -- cgit v1.2.1