refactor docker image creation to use base image

Squashed commits:
- initial work
- make base image use all the versions
- make desktop images use the base image
- update ci to use new images
- use new toolversion script
- update android image tag
- add missing android-26 platform
- fix installing packages with sdkmanager
- fix installation of react-native-cli
- specify prefix path for npm install -g

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-01-18 01:31:07 +01:00
parent 9daef17f11
commit e87464e5ba
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
13 changed files with 185 additions and 258 deletions

View File

@ -1,12 +1,17 @@
ANDROID_BUILD_TOOLS_VERSION;28.0.1; android-ndk;r10e;070be287539e3e7706f8dabfb6bf9879
ANDROID_NDK_VERSION;r10e; android-sdk-build-tools;28.0.1;
ANDROID_PLATFORM_VERSION;android-27; android-sdk-platform;android-27;
android-sdk;4333796;aa190cfd7299cd6a1c687355bb2764e4
clojure_cli;1.9.0.381; clojure_cli;1.9.0.381;
cmake;3.12.2;
conan;1.9.0; conan;1.9.0;
leiningen;2.8.1; leiningen;2.8.1;
maven;3.5.2; maven;3.5.2;
node;10.12.0; node;10.12.0;
nvm;0.33.11; nvm;0.33.11;
qt;5.11.2;974fda61267cfb6e45984ee5f0a285f8
qtci;55ffd9f225708b3aa1443851cfa8dead2c1f9959;
react_native_cli;2.0.1; react_native_cli;2.0.1;
react_native_desktop;v0.56.1_4;
watchman;4.9.0; watchman;4.9.0;
yarn;1.13.0; yarn;1.13.0;

3
.gitignore vendored
View File

@ -66,8 +66,10 @@ index.desktop.js
# Docker # Docker
# #
docker/*/scripts/
docker/*/*.zip docker/*/*.zip
docker/*/*.run docker/*/*.run
docker/*/nvm_install.sh
# Generated by lein voom # Generated by lein voom
# #
@ -153,7 +155,6 @@ Status-Windows-x86_64.exe
/desktop/CMakeFiles/ /desktop/CMakeFiles/
/desktop/reportApp/Makefile /desktop/reportApp/Makefile
/deployment/windows/Status.rc /deployment/windows/Status.rc
/docker/*/scripts/
*_autogen/ *_autogen/
CompleteBundleWin.cmake CompleteBundleWin.cmake
logger_settings.ini logger_settings.ini

View File

@ -2,7 +2,7 @@ pipeline {
agent { agent {
docker { docker {
label 'linux' label 'linux'
image 'statusteam/status-build-android:1.0.1' image 'statusteam/status-build-android:1.1.0'
args ( args (
"-v /home/jenkins/tmp:/var/tmp:rw "+ "-v /home/jenkins/tmp:/var/tmp:rw "+
"-v /home/jenkins/status-im.keystore:/tmp/status-im.keystore:ro" "-v /home/jenkins/status-im.keystore:/tmp/status-im.keystore:ro"
@ -59,34 +59,30 @@ pipeline {
cmn = load 'ci/common.groovy' cmn = load 'ci/common.groovy'
print "Running ${cmn.getBuildType()} build!" print "Running ${cmn.getBuildType()} build!"
cmn.abortPreviousRunningBuilds() cmn.abortPreviousRunningBuilds()
/* Read the valid NodeJS version */
env.NODE_VERSION = cmn.getToolVersion('node')
/* Cleanup and Prep */ /* Cleanup and Prep */
nvm(env.NODE_VERSION) {
mobile.prep(cmn.getBuildType()) mobile.prep(cmn.getBuildType())
} }
} }
} }
}
stage('Lint') { stage('Lint') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runLint() } script { cmn.runLint() }
} } }
} }
stage('Tests') { stage('Tests') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runTests() } script { cmn.runTests() }
} } }
} }
stage('Build') { stage('Build') {
steps { nvm(env.NODE_VERSION) { steps {
script { mobile.leinBuild('android') } script { mobile.leinBuild('android') }
} } }
} }
stage('Bundle') { stage('Bundle') {
steps { nvm(env.NODE_VERSION) { steps {
script { apk = mobile.android.bundle(cmn.getBuildType()) } script { apk = mobile.android.bundle(cmn.getBuildType()) }
} } }
} }
stage('Archive') { stage('Archive') {
steps { steps {

View File

@ -3,7 +3,7 @@ pipeline {
/* privileged mode is necessary for fuse */ /* privileged mode is necessary for fuse */
docker { docker {
label 'linux-new' label 'linux-new'
image 'statusteam/linux-desktop-ubuntu:1.1.1' image 'statusteam/status-build-linux:1.1.0'
args ( args (
"--privileged "+ "--privileged "+
"-v /dev/fuse:/dev/fuse "+ "-v /dev/fuse:/dev/fuse "+
@ -59,34 +59,30 @@ pipeline {
cmn = load 'ci/common.groovy' cmn = load 'ci/common.groovy'
print "Running ${cmn.getBuildType()} build!" print "Running ${cmn.getBuildType()} build!"
cmn.abortPreviousRunningBuilds() cmn.abortPreviousRunningBuilds()
/* Read the valid NodeJS version */
env.NODE_VERSION = cmn.getToolVersion('node')
/* Cleanup and Prep */ /* Cleanup and Prep */
nvm(env.NODE_VERSION) {
desktop.prepDeps() desktop.prepDeps()
} }
} }
} }
}
stage('Lint') { stage('Lint') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runLint() } script { cmn.runLint() }
} } }
} }
stage('Tests') { stage('Tests') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runTests() } script { cmn.runTests() }
} } }
} }
stage('Build') { stage('Build') {
steps { nvm(env.NODE_VERSION) { steps {
script { desktop.buildClojureScript() } script { desktop.buildClojureScript() }
} } }
} }
stage('Compile') { stage('Compile') {
steps { nvm(env.NODE_VERSION) { steps {
script { desktop.compile() } script { desktop.compile() }
} } }
} }
stage('Bundle') { stage('Bundle') {
steps { steps {

View File

@ -3,7 +3,7 @@ pipeline {
/* privileged mode is necessary for fuse */ /* privileged mode is necessary for fuse */
docker { docker {
label 'linux-new' label 'linux-new'
image 'statusteam/windows-desktop-ubuntu:1.1.1' image 'statusteam/status-build-windows:1.1.0'
args ( args (
"--privileged "+ "--privileged "+
"-v /dev/fuse:/dev/fuse "+ "-v /dev/fuse:/dev/fuse "+
@ -62,34 +62,30 @@ pipeline {
cmn = load 'ci/common.groovy' cmn = load 'ci/common.groovy'
print "Running ${cmn.getBuildType()} build!" print "Running ${cmn.getBuildType()} build!"
cmn.abortPreviousRunningBuilds() cmn.abortPreviousRunningBuilds()
/* Read the valid NodeJS version */
env.NODE_VERSION = cmn.getToolVersion('node')
/* Cleanup and Prep */ /* Cleanup and Prep */
nvm(env.NODE_VERSION) {
desktop.prepDeps() desktop.prepDeps()
} }
} }
} }
}
stage('Lint') { stage('Lint') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runLint() } script { cmn.runLint() }
} } }
} }
stage('Tests') { stage('Tests') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.runTests() } script { cmn.runTests() }
} } }
} }
stage('Build') { stage('Build') {
steps { nvm(env.NODE_VERSION) { steps {
script { desktop.buildClojureScript() } script { desktop.buildClojureScript() }
} } }
} }
stage('Compile') { stage('Compile') {
steps { nvm(env.NODE_VERSION) { steps {
script { desktop.compile() } script { desktop.compile() }
} } }
} }
stage('Bundle') { stage('Bundle') {
steps { steps {

View File

@ -1,11 +1,17 @@
# This image is only for extracting and cleaning up NDK and SDK # This image is only for extracting and cleaning up NDK and SDK
FROM statusteam/status-build-base:1.0.0 AS sdk_and_ndk FROM statusteam/status-build-base:1.1.0 AS sdk_and_ndk
ARG ANDROID_NDK_VERSION ARG ANDROID_NDK_VERSION
ARG ANDROID_SDK_VERSION ARG ANDROID_SDK_VERSION
ARG SDK_PLATFORM_VERSION
ARG SDK_BUILD_TOOLS_VERSION
# names of packages to install with sdkmanager # names of packages to install with sdkmanager
ENV SDK_PACKAGES emulator patcher;v4 build-tools;26.0.2 platforms;android-26 platforms;android-27 platforms;android-28 extras;android;m2repository extras;google;m2repository ENV SDK_PACKAGES emulator patcher;v4 \
platforms;android-26 \
platforms;${SDK_PLATFORM_VERSION} \
build-tools;${SDK_BUILD_TOOLS_VERSION} \
extras;android;m2repository extras;google;m2repository
# install SDK # install SDK
COPY sdk-tools-linux-${ANDROID_SDK_VERSION}.zip /tmp/sdk-tools-linux.zip COPY sdk-tools-linux-${ANDROID_SDK_VERSION}.zip /tmp/sdk-tools-linux.zip
@ -32,7 +38,7 @@ RUN cd /usr/lib/android-ndk && rm -fr docs tests samples \
&& find sources -mindepth 2 -maxdepth 2 | grep -v 'gnu-libstdc' | xargs rm -fr && find sources -mindepth 2 -maxdepth 2 | grep -v 'gnu-libstdc' | xargs rm -fr
################################################################################ ################################################################################
FROM statusteam/status-build-base:1.0.0 FROM statusteam/status-build-base:1.1.0
ARG ANDROID_NDK_VERSION ARG ANDROID_NDK_VERSION
ARG ANDROID_SDK_VERSION ARG ANDROID_SDK_VERSION

View File

@ -1,24 +1,31 @@
__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_ROOT = $(shell git rev-parse --show-toplevel) GIT_ROOT = $(shell git rev-parse --show-toplevel)
ANDROID_NDK_VERSION = r10e ANDROID_NDK_VERSION = $(call __toolversion, android-ndk)
ANDROID_NDK_CHECKSUM = 070be287539e3e7706f8dabfb6bf9879 ANDROID_NDK_CHECKSUM = $(call __toolversion, android-ndk_md5)
ANDROID_NDK_ARCHIVE = android-ndk-$(ANDROID_NDK_VERSION)-linux-x86_64.zip ANDROID_NDK_ARCHIVE = android-ndk-$(ANDROID_NDK_VERSION)-linux-x86_64.zip
ANDROID_NDK_URL = https://dl.google.com/android/repository/$(ANDROID_NDK_ARCHIVE) ANDROID_NDK_URL = https://dl.google.com/android/repository/$(ANDROID_NDK_ARCHIVE)
ANDROID_SDK_VERSION = 4333796 ANDROID_SDK_VERSION = $(call __toolversion, android-sdk)
ANDROID_SDK_CHECKSUM = aa190cfd7299cd6a1c687355bb2764e4 ANDROID_SDK_CHECKSUM = $(call __toolversion, android-sdk_md5)
ANDROID_SDK_URL = https://dl.google.com/android/repository/sdk-tools-linux-$(ANDROID_SDK_VERSION).zip ANDROID_SDK_URL = https://dl.google.com/android/repository/sdk-tools-linux-$(ANDROID_SDK_VERSION).zip
ANDROID_SDK_ARCHIVE = sdk-tools-linux-$(ANDROID_SDK_VERSION).zip ANDROID_SDK_ARCHIVE = sdk-tools-linux-$(ANDROID_SDK_VERSION).zip
SDK_PLATFORM_VERSION=$(call __toolversion, android-sdk-platform)
SDK_BUILD_TOOLS_VERSION=$(call __toolversion, android-sdk-build-tools)
# WARNING: Remember to change the tag when updating the image # WARNING: Remember to change the tag when updating the image
IMAGE_TAG = 1.0.1 IMAGE_TAG = 1.1.0
IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG) IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG)
build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE) build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE)
docker build \ docker build \
--build-arg="ANDROID_NDK_VERSION=$(ANDROID_NDK_VERSION)" \ --build-arg="ANDROID_NDK_VERSION=$(ANDROID_NDK_VERSION)" \
--build-arg="ANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)" \ --build-arg="ANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)" \
--build-arg="SDK_PLATFORM_VERSION=$(SDK_PLATFORM_VERSION)" \
--build-arg="SDK_BUILD_TOOLS_VERSION=$(SDK_BUILD_TOOLS_VERSION)" \
--label="commit=$(GIT_COMMIT)" \ --label="commit=$(GIT_COMMIT)" \
-t $(IMAGE_NAME) . -t $(IMAGE_NAME) .

View File

@ -1,17 +1,19 @@
FROM ubuntu:16.04 FROM ubuntu:16.04
ARG NVM_VERSION ARG NODE_VERSION
ARG NVM_NODE_VERSION ARG YARN_VERSION
ARG LEIN_VERSION ARG LEIN_VERSION
# We have to do this because Jenkins doesn't let us # We have to do this because Jenkins doesn't let us
# https://issues.jenkins-ci.org/browse/JENKINS-49076 # https://issues.jenkins-ci.org/browse/JENKINS-49076
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ ENV PATH=/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
LANG=en_US.UTF-8 \ LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \ LC_ALL=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \ LANGUAGE=en_US.UTF-8 \
LEIN_HOME=/var/tmp/lein \ LEIN_HOME=/var/tmp/lein \
YARN_CACHE_FOLDER=/var/tmp/yarn LEIN_URL=https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein \
YARN_CACHE_FOLDER=/var/tmp/yarn \
NVM_DIR=/home/jenkins/.nvm
RUN mkdir /var/tmp/npm /var/tmp/lein \ RUN mkdir /var/tmp/npm /var/tmp/lein \
&& chmod 777 /var/tmp/npm /var/tmp/lein \ && chmod 777 /var/tmp/npm /var/tmp/lein \
@ -20,13 +22,12 @@ RUN mkdir /var/tmp/npm /var/tmp/lein \
&& echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \ && echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
&& echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \ && echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \ && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \ && apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \ && DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
file git wget zip unzip s3cmd build-essential nodejs yarn locales \ file jq git wget zip unzip s3cmd build-essential nodejs locales \
ca-certificates oracle-java8-installer oracle-java8-set-default \ ca-certificates oracle-java8-installer oracle-java8-set-default \
&& locale-gen ${LANG} \ && locale-gen ${LANG} \
&& npm install -g yarn@${YARN_VERSION} \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
@ -39,14 +40,17 @@ RUN addgroup --gid 1002 jenkins \
&& su jenkins -c "git config --global user.name 'jenkins@status.im'" && su jenkins -c "git config --global user.name 'jenkins@status.im'"
# Leiningen setup # Leiningen setup
RUN wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein -O /usr/local/bin/lein \ RUN wget ${LEIN_URL} -O /usr/local/bin/lein \
&& chmod 755 /usr/local/bin/lein \ && chmod 755 /usr/local/bin/lein \
&& lein version && lein version
# Install NVM for Jenkins # Install NVM for Jenkins
RUN su jenkins -c "\ ADD nvm_install.sh /tmp/nvm_install.sh
curl -s -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash && \ RUN su -l jenkins -c \
source ~/.nvm/nvm.sh && nvm install ${NVM_NODE_VERSION} && nvm alias default ${NVM_NODE_VERSION}" "bash /tmp/nvm_install.sh && \
. ${NVM_DIR}/nvm.sh && \
nvm install ${NODE_VERSION} && \
nvm alias default ${NODE_VERSION}"
LABEL source="https://github.com/status-im/status-react/tree/develop/docker/base" \ LABEL source="https://github.com/status-im/status-react/tree/develop/docker/base" \
description="Base Image used for building Status app." \ description="Base Image used for building Status app." \

View File

@ -1,23 +1,22 @@
__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_ROOT = $(shell git rev-parse --show-toplevel) GIT_ROOT = $(shell git rev-parse --show-toplevel)
# Software Versions, URLs, and Checksums
NVM_VERSION = v0.33.11
NVM_INSTALL_SCRIPT = nvm_$(NVM_VERSION)_install.sh
NVM_NODE_VERSION = v10.14.0
LEIN_VERSION = stable
# WARNING: Remember to change the tag when updating the image # WARNING: Remember to change the tag when updating the image
IMAGE_TAG = 1.0.0 IMAGE_TAG = 1.1.0
IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG) IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG)
build: build: nvm_install.sh
docker build \ docker build \
--build-arg="LEIN_VERSION=$(LEIN_VERSION)" \ --build-arg="LEIN_VERSION=$(call __toolversion, leiningen)" \
--build-arg="NVM_VERSION=$(NVM_VERSION)" \ --build-arg="NODE_VERSION=$(call __toolversion, node)" \
--build-arg="NVM_NODE_VERSION=$(NVM_NODE_VERSION)" \ --build-arg="YARN_VERSION=$(call __toolversion, yarn)" \
--label="commit=$(GIT_COMMIT)" \ --label="commit=$(GIT_COMMIT)" \
-t $(IMAGE_NAME) . -t $(IMAGE_NAME) .
nvm_install.sh:
cp $(GIT_ROOT)/scripts/3rd-party/nvm/$(call __toolversion, nvm)/install.sh nvm_install.sh
push: build push: build
docker push $(IMAGE_NAME) docker push $(IMAGE_NAME)

View File

@ -1,14 +1,17 @@
FROM ubuntu:16.04 AS qt_build FROM statusteam/status-build-base:1.1.0 AS qt_build
ARG QT_VERSION ARG QT_VERSION
ARG REACT_NATIVE_DESKTOP_COMMIT_SHA ARG RNATIVE_VERSION
ARG QT_CI_COMMIT_SHA ARG QT_CI_COMMIT
RUN apt-get update && apt-get -q -y --no-install-recommends install software-properties-common && \ ENV XDG_RUNTIME_DIR=/tmp/runtime-root
add-apt-repository -y ppa:git-core/ppa && \
apt-get update && apt-get -y install \ RUN apt-get update \
git libx11-xcb1 libxss1 libasound2 libfontconfig1 libdbus-1-3 && \ && add-apt-repository -y ppa:git-core/ppa \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && apt-get update \
&& apt-get -y install git libx11-xcb1 libxss1 libasound2 libfontconfig1 libdbus-1-3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# This variable defines which parts of QT will be extracted from the .run file. # This variable defines which parts of QT will be extracted from the .run file.
# You can list available packages in a Qt .run file by using: # You can list available packages in a Qt .run file by using:
@ -21,93 +24,63 @@ ENV QT_CI_PACKAGES qt.qt5.5112.gcc_64,qt.qt5.5112.qtwebengine.gcc_64
# NOTE: Unfortunately GitHub doesn't support cloning a specific SHA1, so we need to # NOTE: Unfortunately GitHub doesn't support cloning a specific SHA1, so we need to
# resort to git fetch (https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset) # resort to git fetch (https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset)
ADD qt-opensource-linux-x64-${QT_VERSION}.run /tmp/ ADD qt-opensource-linux-x64-${QT_VERSION}.run /tmp/
RUN mkdir -p /tmp/qtci && cd /tmp/qtci && \ RUN mkdir -p /tmp/qtci \
git init && git remote add origin https://github.com/benlau/qtci.git && \ && cd /tmp/qtci \
git fetch --depth=1 origin ${QT_CI_COMMIT_SHA} && \ && git init \
git reset --hard FETCH_HEAD && \ && git remote add origin https://github.com/benlau/qtci.git \
/tmp/qtci/bin/extract-qt-installer --disable-progress-report \ && git fetch --depth=1 origin ${QT_CI_COMMIT} \
/tmp/qt-opensource-linux-x64-${QT_VERSION}.run /opt/qt-all && \ && git reset --hard FETCH_HEAD \
find /opt/qt-all/${QT_VERSION}/gcc_64/bin -type f -regextype posix-egrep -regex \ && /tmp/qtci/bin/extract-qt-installer --disable-progress-report \
'.*\/(qdoc|qgltf|linguist|designer|assistant|qhelpconverter|qmlprofiler)$' -delete /tmp/qt-opensource-linux-x64-${QT_VERSION}.run /opt/qt-all \
&& find /opt/qt-all/${QT_VERSION}/gcc_64/bin -type f -regextype posix-egrep -regex \
'.*\/(qdoc|qgltf|linguist|designer|assistant|qhelpconverter|qmlprofiler)$' -delete \
&& rm -fr ${XDG_RUNTIME_DIR}
FROM ubuntu:16.04 FROM statusteam/status-build-base:1.1.0
ARG QT_VERSION ARG QT_VERSION
ARG CMAKE_VERSION
COPY --from=qt_build /opt/qt-all/${QT_VERSION}/gcc_64 /opt/qt COPY --from=qt_build /opt/qt-all/${QT_VERSION}/gcc_64 /opt/qt
RUN ln -s /opt/qt/mkspecs /usr/local/mkspecs && \ RUN ln -s /opt/qt/mkspecs /usr/local/mkspecs \
ln -s /opt/qt/plugins /usr/local/plugins && ln -s /opt/qt/plugins /usr/local/plugins
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LEIN_HOME /var/tmp/lein
ENV NPM_CONFIG_CACHE /var/tmp/npm
# We have to do this because Jenkins doesn't let us # We have to do this because Jenkins doesn't let us
# https://issues.jenkins-ci.org/browse/JENKINS-49076 # https://issues.jenkins-ci.org/browse/JENKINS-49076
ENV PATH /opt/qt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PATH /opt/qt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update && apt-get -q -y --no-install-recommends install curl software-properties-common && \ RUN apt-get update \
add-apt-repository -y ppa:git-core/ppa && \ && add-apt-repository -y ppa:git-core/ppa \
add-apt-repository -y ppa:longsleep/golang-backports && \ && add-apt-repository -y ppa:longsleep/golang-backports \
apt-get remove -y software-properties-common && \ && apt-get update \
apt-get update && \ && DEBIAN_FRONTEND=noninteractive \
DEBIAN_FRONTEND=noninteractive \
apt-get -q -y --no-install-recommends install \ apt-get -q -y --no-install-recommends install \
wget git unzip golang-go file s3cmd \ golang-go python python3-pip python3-setuptools python3-wheel \
python python3-pip python3-setuptools python3-wheel \ apt-transport-https openjdk-8-jdk-headless \
apt-transport-https locales openjdk-8-jdk-headless \
extra-cmake-modules build-essential gcc g++ fuse \ extra-cmake-modules build-essential gcc g++ fuse \
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \ libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \
locale-gen en_US.UTF-8 && \ && apt-get clean \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \ RUN cd /tmp \
tar xf cmake-3.12.2-Linux-x86_64.tar.gz --strip 1 -C /usr/local && \ && wget -q https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \
rm -fr /usr/local/doc/cmake && rm cmake-3.12.2-Linux-x86_64.tar.gz && tar xf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip 1 -C /usr/local \
&& rm -fr /usr/local/doc/cmake \
&& rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
ARG LEIN_VERSION RUN mkdir -p /tmp/react-native-desktop \
ENV LEIN_INSTALL=/usr/bin/ && cd /tmp/react-native-desktop \
&& git init \
RUN mkdir -p $LEIN_INSTALL \ && git remote add origin https://github.com/status-im/react-native-desktop.git \
&& wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein-pkg \ && git fetch --quiet --depth=1 origin ${RNATIVE_VERSION} \
&& mv lein-pkg $LEIN_INSTALL/lein \ && git reset --hard FETCH_HEAD \
&& chmod 0755 $LEIN_INSTALL/lein \ && cp -r /tmp/react-native-desktop/react-native-cli /opt \
&& wget -q https://github.com/technomancy/leiningen/releases/download/${LEIN_VERSION}/leiningen-${LEIN_VERSION}-standalone.zip \ && cd /opt/react-native-cli \
&& mkdir -p /usr/share/java \ && npm update \
&& mv leiningen-${LEIN_VERSION}-standalone.zip /usr/share/java/leiningen-${LEIN_VERSION}-standalone.jar \ && npm install -g --prefix /usr/local \
&& $LEIN_INSTALL/lein version && cd \
&& rm -r /tmp/react-native-desktop
ARG NVM_VERSION
ARG NODE_VERSION
ARG YARN_VERSION
ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/
RUN /tmp/nvm/${NVM_VERSION}/install.sh && \
mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \
git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \
git reset --hard FETCH_HEAD && \
cp -r /tmp/react-native-desktop/react-native-cli /opt && \
cd /opt/react-native-cli && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
npm install -g yarn@${YARN_VERSION} && \
npm update && npm install -g && \
cd && rm -r /tmp/react-native-desktop
# These are the UID and GID values used by Jenkins
RUN addgroup --gid 1002 jenkins && \
adduser --shell /bin/bash \
--disabled-password --gecos "" \
--uid 1001 --gid 1002 jenkins
# Install NVM for Jenkins
RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh'
LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/docker" \ LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/docker" \
description="Image for building Linux Desktop version of Status app." \ description="Image for building Linux Desktop version of Status app." \

View File

@ -3,37 +3,26 @@ __toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_ROOT = $(shell git rev-parse --show-toplevel) GIT_ROOT = $(shell git rev-parse --show-toplevel)
# WARNING: Change version in Dockerfile too QT_VERSION = $(call __toolversion, qt)
QT_VERSION = 5.11.2 QT_MD5SUM = $(call __toolversion, qt_md5)
QT_VER_MJR = 5.11
QT_ARCHIVE = qt-opensource-linux-x64-$(QT_VERSION).run QT_ARCHIVE = qt-opensource-linux-x64-$(QT_VERSION).run
QT_MD5SUM = 974fda61267cfb6e45984ee5f0a285f8
QT_URL = https://download.qt.io/archive/qt QT_URL = https://download.qt.io/archive/qt
QT_CI_COMMIT_SHA = 55ffd9f225708b3aa1443851cfa8dead2c1f9959
REACT_NATIVE_DESKTOP_COMMIT_SHA = 2a76c435a27f0bf6c089f74222212b3a58e10385
# WARNING: Remember to change the tag when updating the image # WARNING: Remember to change the tag when updating the image
IMAGE_TAG = 1.1.1 IMAGE_TAG = 1.1.0
IMAGE_NAME = statusteam/linux-desktop-ubuntu:$(IMAGE_TAG) IMAGE_NAME = statusteam/status-build-linux:$(IMAGE_TAG)
build: $(QT_ARCHIVE) build: $(QT_ARCHIVE)
rm -rf ./scripts && \
mkdir -p ./scripts/3rd-party && \
cp -R ../../scripts/3rd-party/ ./scripts/ && \
docker build \ docker build \
--build-arg="QT_VERSION=$(QT_VERSION)" \ --build-arg="QT_VERSION=$(QT_VERSION)" \
--build-arg="QT_CI_COMMIT_SHA=$(QT_CI_COMMIT_SHA)" \ --build-arg="QT_CI_COMMIT=$(call __toolversion, qtci)" \
--build-arg="REACT_NATIVE_DESKTOP_COMMIT_SHA=$(REACT_NATIVE_DESKTOP_COMMIT_SHA)" \ --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \
--build-arg="LEIN_VERSION=$(call __toolversion,lein)" \ --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \
--build-arg="NODE_VERSION=$(call __toolversion,node)" \
--build-arg="NVM_VERSION=$(call __toolversion,nvm)" \
--build-arg="YARN_VERSION=$(call __toolversion,yarn)" \
--label="commit=$(GIT_COMMIT)" \ --label="commit=$(GIT_COMMIT)" \
-t $(IMAGE_NAME) .; \ -t $(IMAGE_NAME) .; \
rm -rf ./scripts
$(QT_ARCHIVE): $(QT_ARCHIVE):
wget $(QT_URL)/$(QT_VER_MJR)/$(QT_VERSION)/$(QT_ARCHIVE) wget $(QT_URL)/$(call __major_version__, $(QT_VERSION))/$(QT_VERSION)/$(QT_ARCHIVE)
echo "$(QT_MD5SUM) $(QT_ARCHIVE)" | md5sum --check echo "$(QT_MD5SUM) $(QT_ARCHIVE)" | md5sum --check
push: build push: build

View File

@ -1,79 +1,42 @@
FROM ubuntu:16.04 FROM statusteam/status-build-base:1.1.0
ARG REACT_NATIVE_DESKTOP_COMMIT_SHA
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LEIN_HOME /var/tmp/lein
ENV NPM_CONFIG_CACHE /var/tmp/npm
# We have to do this because Jenkins doesn't let us
# https://issues.jenkins-ci.org/browse/JENKINS-49076
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ARG RNATIVE_VERSION
ARG CONAN_VERSION ARG CONAN_VERSION
ARG CMAKE_VERSION
RUN apt-get update && apt-get -q -y --no-install-recommends install curl software-properties-common && \ RUN add-apt-repository -y ppa:git-core/ppa \
add-apt-repository -y ppa:git-core/ppa && \ && add-apt-repository -y ppa:longsleep/golang-backports \
add-apt-repository -y ppa:longsleep/golang-backports && \ && apt-get update \
apt-get remove -y software-properties-common && \ && DEBIAN_FRONTEND=noninteractive \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -q -y --no-install-recommends install \ apt-get -q -y --no-install-recommends install \
wget git nsis unzip golang-go file jq s3cmd \ nsis fuse golang-go python python3-pip python3-setuptools python3-wheel \
python python3-pip python3-setuptools python3-wheel \ apt-transport-https openjdk-8-jdk-headless extra-cmake-modules build-essential \
apt-transport-https locales openjdk-8-jdk-headless \
extra-cmake-modules build-essential fuse \
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \ libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \
locale-gen en_US.UTF-8 && \ && apt-get clean \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man \
python3 -m pip install --upgrade pip && \ && python3 -m pip install --upgrade pip \
pip3 install conan==${CONAN_VERSION} && pip3 install conan==${CONAN_VERSION}
RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \ RUN cd /tmp \
tar xf cmake-3.12.2-Linux-x86_64.tar.gz --strip 1 -C /usr/local && \ && wget -q https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \
rm -fr /usr/local/doc/cmake && rm cmake-3.12.2-Linux-x86_64.tar.gz && tar xf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip 1 -C /usr/local \
&& rm -fr /usr/local/doc/cmake \
&& rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
ARG LEIN_VERSION RUN mkdir -p /tmp/react-native-desktop \
ENV LEIN_INSTALL=/usr/bin/ && cd /tmp/react-native-desktop \
&& git --version \
RUN mkdir -p $LEIN_INSTALL \ && git init \
&& wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein-pkg \ && git remote add origin https://github.com/status-im/react-native-desktop.git \
&& mv lein-pkg $LEIN_INSTALL/lein \ && git fetch --depth=1 origin ${RNATIVE_VERSION} \
&& chmod 0755 $LEIN_INSTALL/lein \ && git reset --hard FETCH_HEAD \
&& wget -q https://github.com/technomancy/leiningen/releases/download/${LEIN_VERSION}/leiningen-${LEIN_VERSION}-standalone.zip \ && cp -r /tmp/react-native-desktop/react-native-cli /opt \
&& mkdir -p /usr/share/java \ && cd /opt/react-native-cli \
&& mv leiningen-${LEIN_VERSION}-standalone.zip /usr/share/java/leiningen-${LEIN_VERSION}-standalone.jar \ && npm update \
&& $LEIN_INSTALL/lein version && npm install -g --prefix /usr/local \
&& cd \
ARG NVM_VERSION && rm -r /tmp/react-native-desktop
ARG NODE_VERSION
ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/
RUN /tmp/nvm/${NVM_VERSION}/install.sh && \
mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
git --version && \
git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \
git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \
git reset --hard FETCH_HEAD && \
cp -r /tmp/react-native-desktop/react-native-cli /opt && \
cd /opt/react-native-cli && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
npm update && npm install -g && \
cd && rm -r /tmp/react-native-desktop
# These are the UID and GID values used by Jenkins
RUN addgroup --gid 1002 jenkins && \
adduser --shell /bin/bash \
--disabled-password --gecos "" \
--uid 1001 --gid 1002 jenkins
# Install NVM for Jenkins
RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh'
LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/windows/docker" \ LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/windows/docker" \
description="Image for building Windows Desktop version of Status app." \ description="Image for building Windows Desktop version of Status app." \

View File

@ -4,24 +4,16 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_ROOT = $(shell git rev-parse --show-toplevel) GIT_ROOT = $(shell git rev-parse --show-toplevel)
# WARNING: Remember to change the tag when updating the image # WARNING: Remember to change the tag when updating the image
IMAGE_TAG = 1.1.1 IMAGE_TAG = 1.1.0
IMAGE_NAME = statusteam/windows-desktop-ubuntu:$(IMAGE_TAG) IMAGE_NAME = statusteam/status-build-windows:$(IMAGE_TAG)
REACT_NATIVE_DESKTOP_COMMIT_SHA = 2a76c435a27f0bf6c089f74222212b3a58e10385
build: build:
rm -rf ./scripts && \
mkdir -p ./scripts/3rd-party && \
cp -R ../../scripts/3rd-party/ ./scripts/ && \
docker build \ docker build \
--build-arg="REACT_NATIVE_DESKTOP_COMMIT_SHA=$(REACT_NATIVE_DESKTOP_COMMIT_SHA)" \ --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \
--build-arg="CONAN_VERSION=$(call __toolversion, conan)" \ --build-arg="CONAN_VERSION=$(call __toolversion, conan)" \
--build-arg="LEIN_VERSION=$(call __toolversion,lein)" \ --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \
--build-arg="NODE_VERSION=$(call __toolversion,node)" \
--build-arg="NVM_VERSION=$(call __toolversion,nvm)" \
--label="commit=$(GIT_COMMIT)" \ --label="commit=$(GIT_COMMIT)" \
-t $(IMAGE_NAME) .; \ -t $(IMAGE_NAME) .; \
rm -rf ./scripts
push: build push: build
docker push $(IMAGE_NAME) docker push $(IMAGE_NAME)