From 4bf08307966f8bf7fdc9f8100d9c4898c99fac95 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Fri, 24 Apr 2020 18:12:02 -0600 Subject: [PATCH 1/3] Update build envs to ubunto 20.04. Change mingw build env to arch --- linux-clang-format/Dockerfile | 2 +- linux-fresh/Dockerfile | 18 +++++++++++--- linux-mingw/Dockerfile | 47 +++++++++++++++++++++++++++++------ linux-mingw/mingw-setup.sh | 8 ------ 4 files changed, 55 insertions(+), 20 deletions(-) diff --git a/linux-clang-format/Dockerfile b/linux-clang-format/Dockerfile index 608e363..47b598c 100644 --- a/linux-clang-format/Dockerfile +++ b/linux-clang-format/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER yuzu RUN useradd -m -s /bin/bash yuzu RUN apt-get update && apt-get -y full-upgrade diff --git a/linux-fresh/Dockerfile b/linux-fresh/Dockerfile index abdc099..08cbe38 100644 --- a/linux-fresh/Dockerfile +++ b/linux-fresh/Dockerfile @@ -1,5 +1,17 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER yuzu RUN useradd -m -s /bin/bash yuzu -RUN apt-get update && apt-get -y full-upgrade -RUN apt-get install --no-install-recommends -y build-essential libsdl2-dev libssl-dev python qtbase5-dev qtwebengine5-dev libqt5opengl5-dev wget git ccache cmake ninja-build +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y full-upgrade +RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + build-essential \ + libsdl2-dev \ + libssl-dev \ + python \ + qtbase5-dev \ + qtwebengine5-dev \ + libqt5opengl5-dev \ + wget \ + git \ + ccache \ + cmake \ + ninja-build diff --git a/linux-mingw/Dockerfile b/linux-mingw/Dockerfile index dac207c..a230aad 100644 --- a/linux-mingw/Dockerfile +++ b/linux-mingw/Dockerfile @@ -1,12 +1,43 @@ -FROM ubuntu:18.04 +FROM archlinux:latest MAINTAINER yuzu RUN useradd -m -s /bin/bash yuzu && mkdir -p /tmp/pkgs -RUN apt-get update && apt-get install -y gpg wget git python3-pip python ccache p7zip-full g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64-tools cmake ninja-build -# workaround broken headers in Ubuntu MinGW package -COPY errno.h /usr/x86_64-w64-mingw32/include/ -# add mingw-w64 auxiliary ppa repository -RUN echo 'deb http://ppa.launchpad.net/tobydox/mingw-w64/ubuntu bionic main ' > /etc/apt/sources.list.d/extras.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv '72931B477E22FEFD47F8DECE02FE5F12ADDE29B2' && apt-get update -RUN apt-get install -y sdl2-mingw-w64 qt5base-mingw-w64 qt5tools-mingw-w64 libsamplerate-mingw-w64 qt5multimedia-mingw-w64 +# Add mingw-repo "ownstuff" is a AUR with an up to date mingw64 +RUN echo "[ownstuff]" >> /etc/pacman.conf \ + && echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf \ + && echo "Server = https://martchus.no-ip.biz/repo/arch/ownstuff/os/\$arch" >> /etc/pacman.conf +RUN pacman -Syu --noconfirm +RUN pacman -Syu --noconfirm +RUN pacman -S --needed --noconfirm --noprogressbar \ + base-devel \ + gnupg \ + wget \ + git \ + python-pip \ + python \ + ccache \ + p7zip \ + cmake \ + ninja \ + mingw-w64-gcc \ + mingw-w64-tools \ + mingw-w64-sdl2 \ + mingw-w64-qt5-base \ + mingw-w64-qt5-tools \ + mingw-w64-qt5-graphicaleffects \ + mingw-w64-qt5-multimedia \ + mingw-w64-qt5-winextras \ + python2 \ + mingw-w64-opus \ + mingw-w64-winpthreads + COPY mingw-setup.sh /tmp/pkgs RUN cd /tmp/pkgs && bash -e mingw-setup.sh +# Compatibility with the old Ubuntu MingW image +RUN ln -s /usr/x86_64-w64-mingw32/lib/qt /usr/x86_64-w64-mingw32/lib/qt5 + +# Cleanup +USER root +RUN pacman -Scc --noconfirm +RUN rm -rf /usr/share/man/*; \ + rm -rf /tmp/*; \ + rm -rf /var/tmp/*; diff --git a/linux-mingw/mingw-setup.sh b/linux-mingw/mingw-setup.sh index 728eab7..4538a3c 100644 --- a/linux-mingw/mingw-setup.sh +++ b/linux-mingw/mingw-setup.sh @@ -2,14 +2,6 @@ # install pefile pip3 install pefile -MINGW_URL='https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download' -TARGET_DIR='mingw64/x86_64-w64-mingw32/lib/' - -echo 'Downloading MinGW replacement binaries...' -wget -q "${MINGW_URL}" -O 'mingw.7z' -7z x 'mingw.7z' "${TARGET_DIR}"lib{mf,mfplat,mfuuid}.a -cp -rv "${TARGET_DIR}"/* '/usr/x86_64-w64-mingw32/lib/' - # ffmpeg FFMPEG_VER='4.1' for i in 'shared' 'dev'; do From affcece6a6ffe9d98c399354d00bd26074d0995c Mon Sep 17 00:00:00 2001 From: James Rowe Date: Fri, 24 Apr 2020 21:52:57 -0600 Subject: [PATCH 2/3] Remove any leftover apt caches --- linux-clang-format/Dockerfile | 3 +++ linux-fresh/Dockerfile | 3 +++ linux-transifex/Dockerfile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/linux-clang-format/Dockerfile b/linux-clang-format/Dockerfile index 47b598c..4b5cf51 100644 --- a/linux-clang-format/Dockerfile +++ b/linux-clang-format/Dockerfile @@ -3,3 +3,6 @@ MAINTAINER yuzu RUN useradd -m -s /bin/bash yuzu RUN apt-get update && apt-get -y full-upgrade RUN apt-get install -y git clang-format-6.0 + +# cleanup all extra information that apt may be caching to save storage space +RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ diff --git a/linux-fresh/Dockerfile b/linux-fresh/Dockerfile index 08cbe38..627d35c 100644 --- a/linux-fresh/Dockerfile +++ b/linux-fresh/Dockerfile @@ -15,3 +15,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ ccache \ cmake \ ninja-build + +# cleanup all extra information that apt may be caching to save storage space +RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ diff --git a/linux-transifex/Dockerfile b/linux-transifex/Dockerfile index 9ad669e..5531753 100644 --- a/linux-transifex/Dockerfile +++ b/linux-transifex/Dockerfile @@ -2,3 +2,6 @@ FROM alpine RUN adduser -u 1000 -D -s /bin/bash yuzu RUN apk update && apk add build-base cmake python3-dev qt5-qttools-dev qt5-qtmultimedia-dev RUN pip3 install transifex-client + +# cleanup all extra information that apt may be caching to save storage space +RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ From 48dc64253f601d80b91b87e351494360ab8821db Mon Sep 17 00:00:00 2001 From: James Rowe Date: Thu, 30 Apr 2020 22:39:10 -0600 Subject: [PATCH 3/3] Combine RUN statements into one and remove shell expansion --- linux-clang-format/Dockerfile | 10 ++++------ linux-fresh/Dockerfile | 13 ++++++------- linux-mingw/Dockerfile | 26 ++++++++++++-------------- linux-transifex/Dockerfile | 15 +++++++++------ 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/linux-clang-format/Dockerfile b/linux-clang-format/Dockerfile index 4b5cf51..cc69488 100644 --- a/linux-clang-format/Dockerfile +++ b/linux-clang-format/Dockerfile @@ -1,8 +1,6 @@ FROM ubuntu:20.04 MAINTAINER yuzu -RUN useradd -m -s /bin/bash yuzu -RUN apt-get update && apt-get -y full-upgrade -RUN apt-get install -y git clang-format-6.0 - -# cleanup all extra information that apt may be caching to save storage space -RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ +RUN useradd -m -s /bin/bash yuzu && \ + apt-get update && apt-get -y full-upgrade && \ + apt-get install -y git clang-format-6.0 && \ + apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log diff --git a/linux-fresh/Dockerfile b/linux-fresh/Dockerfile index 627d35c..3e3d56a 100644 --- a/linux-fresh/Dockerfile +++ b/linux-fresh/Dockerfile @@ -1,20 +1,19 @@ FROM ubuntu:20.04 MAINTAINER yuzu -RUN useradd -m -s /bin/bash yuzu -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y full-upgrade -RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ +RUN useradd -m -s /bin/bash yuzu && \ + DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y full-upgrade && \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ build-essential \ libsdl2-dev \ libssl-dev \ python \ qtbase5-dev \ + qtbase5-private-dev \ qtwebengine5-dev \ libqt5opengl5-dev \ wget \ git \ ccache \ cmake \ - ninja-build - -# cleanup all extra information that apt may be caching to save storage space -RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ + ninja-build && \ + apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log diff --git a/linux-mingw/Dockerfile b/linux-mingw/Dockerfile index a230aad..7fee4e4 100644 --- a/linux-mingw/Dockerfile +++ b/linux-mingw/Dockerfile @@ -1,13 +1,13 @@ FROM archlinux:latest MAINTAINER yuzu -RUN useradd -m -s /bin/bash yuzu && mkdir -p /tmp/pkgs # Add mingw-repo "ownstuff" is a AUR with an up to date mingw64 -RUN echo "[ownstuff]" >> /etc/pacman.conf \ - && echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf \ - && echo "Server = https://martchus.no-ip.biz/repo/arch/ownstuff/os/\$arch" >> /etc/pacman.conf -RUN pacman -Syu --noconfirm -RUN pacman -Syu --noconfirm -RUN pacman -S --needed --noconfirm --noprogressbar \ +RUN useradd -m -s /bin/bash yuzu && mkdir -p /tmp/pkgs && \ + echo "[ownstuff]" >> /etc/pacman.conf && \ + echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf && \ + echo "Server = https://martchus.no-ip.biz/repo/arch/ownstuff/os/\$arch" >> /etc/pacman.conf && \ + pacman -Syu --noconfirm && \ + pacman -Syu --noconfirm && \ + pacman -S --needed --noconfirm --noprogressbar \ base-devel \ gnupg \ wget \ @@ -28,16 +28,14 @@ RUN pacman -S --needed --noconfirm --noprogressbar \ mingw-w64-qt5-winextras \ python2 \ mingw-w64-opus \ - mingw-w64-winpthreads + mingw-w64-winpthreads && \ + pacman -Scc --noconfirm && \ + rm -rf /usr/share/man/ /tmp/ /var/tmp/ -COPY mingw-setup.sh /tmp/pkgs -RUN cd /tmp/pkgs && bash -e mingw-setup.sh +COPY mingw-setup.sh /tmp/ +RUN cd /tmp/ && bash -e mingw-setup.sh # Compatibility with the old Ubuntu MingW image RUN ln -s /usr/x86_64-w64-mingw32/lib/qt /usr/x86_64-w64-mingw32/lib/qt5 # Cleanup USER root -RUN pacman -Scc --noconfirm -RUN rm -rf /usr/share/man/*; \ - rm -rf /tmp/*; \ - rm -rf /var/tmp/*; diff --git a/linux-transifex/Dockerfile b/linux-transifex/Dockerfile index 5531753..acdfa1e 100644 --- a/linux-transifex/Dockerfile +++ b/linux-transifex/Dockerfile @@ -1,7 +1,10 @@ FROM alpine -RUN adduser -u 1000 -D -s /bin/bash yuzu -RUN apk update && apk add build-base cmake python3-dev qt5-qttools-dev qt5-qtmultimedia-dev -RUN pip3 install transifex-client - -# cleanup all extra information that apt may be caching to save storage space -RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ +MAINTAINER yuzu +RUN adduser -u 1000 -D -s /bin/bash yuzu && \ + apk update && apk add build-base && \ + cmake \ + python3-dev \ + qt5-qttools-dev \ + qt5-qtmultimedia-dev && \ + pip3 install transifex-client && \ + apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log/