From 6d81c80b40ea9ce53be9ee4144703ff0aac46f19 Mon Sep 17 00:00:00 2001 From: Muzahid Hussain Date: Thu, 14 Jan 2021 07:58:31 +0100 Subject: [PATCH] add docker composer for multistage build with single file and remove all unwanted files --- Dockerfile | 5 ++-- build.sh | 17 ------------ docker-compose.yml | 13 ++++++++++ docker/bionic-buildenv.docker | 49 ----------------------------------- docker/bionic-travis.docker | 21 --------------- docker/bionic-wine.docker | 37 -------------------------- 6 files changed, 16 insertions(+), 126 deletions(-) delete mode 100644 build.sh create mode 100644 docker-compose.yml delete mode 100644 docker/bionic-buildenv.docker delete mode 100644 docker/bionic-travis.docker delete mode 100644 docker/bionic-wine.docker diff --git a/Dockerfile b/Dockerfile index 148f3f4..b70dbd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:bionic + +FROM ubuntu:bionic AS pybm-build ENV DEBIAN_FRONTEND noninteractive @@ -51,7 +52,7 @@ RUN echo 'pool ALL=ALL NOPASSWD:ALL' >> /etc/sudoers ## pybm-travis -FROM pybm-build +FROM pybm-build AS buildbot-test RUN pip install --upgrade setuptools diff --git a/build.sh b/build.sh deleted file mode 100644 index c8c7692..0000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -echo Building pybm-build build - -## pybm-build build -sudo docker build -t pybm-build -f docker/bionic-buildenv.docker . - -## pybm-travis build -echo Building pybm-travis build - -sudo docker build -t pybm-travis -f docker/bionic-travis.docker . - -## pybm-travis build -echo Building pybm-travis container - -sudo docker run pybm-travis -## pybm-wine build -#docker build -t pybm-wine -f bionic-wine.docker . diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3d47e03 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.4" +services: + pybm-build: + image: pybm-build + build: + dockerfile: Dockerfile + context: . + buildbot-test: + image: buildbot-test + build: + dockerfile: Dockerfile + context: . + target: pybm-build diff --git a/docker/bionic-buildenv.docker b/docker/bionic-buildenv.docker deleted file mode 100644 index 83b8c66..0000000 --- a/docker/bionic-buildenv.docker +++ /dev/null @@ -1,49 +0,0 @@ -FROM ubuntu:bionic - -ENV DEBIAN_FRONTEND noninteractive - -RUN dpkg --add-architecture i386 - -RUN apt-get update - -RUN apt-get -y install sudo - -# travis xenial bionic -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - python-setuptools libssl-dev libpq-dev python-prctl python-dev python-dev python-virtualenv python-pip - -# travis focal -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - python-setuptools libpcap-dev libpq-dev python-prctl python-dev libpcap-dev python3-virtualenv python3-pip - -# dpkg -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - python-minimal python-setuptools python-all python openssl libssl-dev \ - dh-apparmor debhelper dh-python python-msgpack python-qt4 git python-stdeb \ - python-all-dev - -# Code quality -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - pylint python-pycodestyle python3-pycodestyle pycodestyle python-flake8 \ - python3-flake8 flake8 python-pyflakes python3-pyflakes pyflakes pyflakes3 \ - curl - -# Wine32 -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - python python-pip wget wine-stable winetricks mingw-w64 wine32 wine64 xvfb - -# Wine64 -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - python python-pip wget wine-stable winetricks mingw-w64 wine32 wine64 xvfb - -# Buildbot -RUN apt-get install -yq --no-install-suggests --no-install-recommends \ - buildbot-slave - -# travis2bash -RUN wget -O /usr/local/bin/travis2bash.sh https://storage.bitmessage.org/travis2bash.sh -RUN chmod a+x /usr/local/bin/travis2bash.sh - -RUN useradd -ms /bin/bash pool - -RUN echo 'pool ALL=ALL NOPASSWD:ALL' >> /etc/sudoers diff --git a/docker/bionic-travis.docker b/docker/bionic-travis.docker deleted file mode 100644 index 8cc4c06..0000000 --- a/docker/bionic-travis.docker +++ /dev/null @@ -1,21 +0,0 @@ -FROM pybm-build - -RUN pip install --upgrade setuptools - -ENV HOME /root - -WORKDIR $HOME - -RUN git clone https://github.com/Bitmessage/PyBitmessage - -RUN apt-get -y install python-prctl g++ - -WORKDIR $HOME/PyBitmessage -ENV PATH $HOME/.local/bin:$PATH - -RUN pip install -r requirements.txt -RUN ln -s src pybitmessage -RUN python setup.py install --user -RUN python checkdeps.py -RUN xvfb-run src/bitmessagemain.py -t -RUN python setup.py test diff --git a/docker/bionic-wine.docker b/docker/bionic-wine.docker deleted file mode 100644 index e11fb8f..0000000 --- a/docker/bionic-wine.docker +++ /dev/null @@ -1,37 +0,0 @@ -FROM pybm-build - -RUN pip install --upgrade setuptools -RUN pip install pycrypto -ENV HOME /root - -RUN mkdir $HOME/Downloads -WORKDIR $HOME/Downloads -RUN wget https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi - -WORKDIR $HOME -RUN git clone https://github.com/Bitmessage/PyBitmessage - -WORKDIR $HOME/PyBitmessage -ENV PATH $HOME/.local/bin:$PATH -RUN ln -s src pybitmessage - -# 64b -RUN xvfb-run --auto-servernum --server-num=1 buildscripts/winbuild.sh -ENV WINEPREFIX $HOME/.wine64 -ENV WINEARCH=win64 -RUN xvfb-run --auto-servernum --server-num=1 wine msiexec -i $HOME/Downloads/VCForPython27.msi /q /norestart -RUN xvfb-run --auto-servernum --server-num=1 winetricks -q dotnet40 -RUN xvfb-run --auto-servernum --server-num=1 wine pip install wheel -RUN xvfb-run --auto-servernum --server-num=1 wine python setup.py test - -# 32b -RUN xvfb-run --auto-servernum --server-num=2 i386 buildscripts/winbuild.sh -ENV WINEPREFIX $HOME/.wine32 -ENV WINEARCH=wine32 -RUN xvfb-run --auto-servernum --server-num=3 i386 wine msiexec -i $HOME/Downloads/VCForPython27.msi /q /norestart -RUN xvfb-run --auto-servernum --server-num=4 i386 winetricks -q dotnet40 -RUN xvfb-run --auto-servernum --server-num=5 i386 wine pip install wheel -RUN xvfb-run --auto-servernum --server-num=6 i386 wine python setup.py test - - -