Dockerfile updates: (#2556)
- New Dockerfile for running samples - New Dockerfile for K/N distribution - Samples: buildSh should finilize buildAllSamples task to avoid concurrency issues - Samples: Build avoidance for html5Canvas
This commit is contained in:
@@ -61,8 +61,8 @@ task buildSamplesWithPlatformLibs() {
|
||||
}
|
||||
|
||||
task buildAllSamples() {
|
||||
dependsOn buildSh
|
||||
subprojects.each {
|
||||
dependsOn("${it.path}:assemble")
|
||||
}
|
||||
finalizedBy buildSh
|
||||
}
|
||||
|
||||
@@ -42,7 +42,13 @@ task jsinterop(type: Exec) {
|
||||
def ext = MPPTools.isWindows() ? '.bat' : ''
|
||||
def distributionPath = project.properties['org.jetbrains.kotlin.native.home'] as String
|
||||
if (distributionPath != null) {
|
||||
commandLine Paths.get(file(distributionPath).path, 'bin', "jsinterop$ext").toString(),
|
||||
def jsinteropCommand = Paths.get(file(distributionPath).path, 'bin', "jsinterop$ext").toString()
|
||||
|
||||
inputs.property('jsinteropCommand', jsinteropCommand)
|
||||
inputs.property('jsinteropPackageName', packageName)
|
||||
outputs.file(jsinteropKlibFileName)
|
||||
|
||||
commandLine jsinteropCommand,
|
||||
'-pkg', packageName,
|
||||
'-o', jsinteropKlibFileName,
|
||||
'-target', 'wasm32'
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
FROM ubuntu:18.04
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget
|
||||
RUN apt-get install -y default-jdk
|
||||
ENV version 0.8.1
|
||||
ENV kotlin_native kotlin-native-linux-${version}
|
||||
RUN wget https://download-cf.jetbrains.com/kotlin/native/builds/releases/${version}/linux/${kotlin_native}.tar.gz
|
||||
RUN tar xzf ${kotlin_native}.tar.gz
|
||||
RUN echo "export PATH=\$PATH:/${kotlin_native}/bin" > /.rc.entry
|
||||
ENTRYPOINT /bin/bash --rcfile /.rc.entry
|
||||
@@ -0,0 +1,39 @@
|
||||
FROM ubuntu
|
||||
|
||||
ENV konan_data_dir=/opt/konan
|
||||
ENV gradle_version=4.10.2
|
||||
ENV gradle_install_path=/opt/gradle-${gradle_version}
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y upgrade
|
||||
RUN apt-get -y install wget unzip
|
||||
|
||||
RUN mkdir /tmp/kotlin-native-bootstrap
|
||||
WORKDIR /tmp/kotlin-native-bootstrap
|
||||
|
||||
# Install JDK 8:
|
||||
RUN apt-get -y install openjdk-8-jdk
|
||||
|
||||
# Install Gradle:
|
||||
RUN wget https://services.gradle.org/distributions/gradle-${gradle_version}-bin.zip
|
||||
RUN unzip ./gradle-*.zip
|
||||
RUN mv ./gradle-${gradle_version} ${gradle_install_path}
|
||||
|
||||
# Install Kotlin/Native through the bootstrap Gradle project:
|
||||
COPY ./build.gradle.kts ./
|
||||
RUN mkdir ${konan_data_dir}
|
||||
RUN KONAN_DATA_DIR=${konan_data_dir} ${gradle_install_path}/bin/gradle model
|
||||
|
||||
# For login shells (ex: docker attach <hash>):
|
||||
RUN echo '#!/bin/sh' > /etc/profile.d/konan.sh
|
||||
RUN echo "export KONAN_DATA_DIR=${konan_data_dir}" >> /etc/profile.d/konan.sh
|
||||
RUN echo "export PATH=\$PATH:`ls -1d ${konan_data_dir}/kotlin-native-*/ | head -n 1`bin" >> /etc/profile.d/konan.sh
|
||||
RUN chmod +x /etc/profile.d/konan.sh
|
||||
|
||||
# For non-login shells (ex: docker exec -it <hash> bash):
|
||||
RUN echo '. /etc/profile.d/konan.sh' > /root/.bashrc
|
||||
|
||||
RUN rm -rf /tmp/*
|
||||
WORKDIR /root
|
||||
|
||||
ENTRYPOINT /bin/bash
|
||||
@@ -0,0 +1,54 @@
|
||||
FROM ubuntu
|
||||
|
||||
ENV jdk_download_url=https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
|
||||
ENV jdk_install_path=/opt/jdk
|
||||
ENV konan_data_dir=/opt/konan
|
||||
ENV gradle_version=4.10.2
|
||||
ENV gradle_install_path=/opt/gradle-${gradle_version}
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y upgrade
|
||||
RUN apt-get -y install wget unzip
|
||||
|
||||
RUN mkdir /tmp/kotlin-native-bootstrap
|
||||
WORKDIR /tmp/kotlin-native-bootstrap
|
||||
|
||||
# Obtain the freshest CA certs bundle from the latest available JDK.
|
||||
# Need it because newer CA certs will allow making SSL handshakes to AWS-hosted hosts such as https://downloads.jetbrains.com.
|
||||
RUN apt-get -y install default-jdk
|
||||
RUN update-alternatives --list java | sed 's/\/bin\/java$//' | xargs -I %% cp %%/lib/security/cacerts ./
|
||||
RUN apt-get -y purge --auto-remove default-jdk
|
||||
|
||||
# Install non-LTS JDK:
|
||||
RUN wget ${jdk_download_url}
|
||||
RUN tar -xzf openjdk-*.tar.gz
|
||||
RUN mv ./jdk* ${jdk_install_path}
|
||||
# use newer CA certs:
|
||||
RUN mv ${jdk_install_path}/lib/security/cacerts ${jdk_install_path}/lib/security/cacerts.orig
|
||||
RUN cp ./cacerts ${jdk_install_path}/lib/security/
|
||||
RUN update-alternatives --install /usr/bin/java java ${jdk_install_path}/bin/java 1
|
||||
RUN update-alternatives --install /usr/bin/javac javac ${jdk_install_path}/bin/javac 1
|
||||
|
||||
# Install Gradle:
|
||||
RUN wget https://services.gradle.org/distributions/gradle-${gradle_version}-bin.zip
|
||||
RUN unzip ./gradle-*.zip
|
||||
RUN mv ./gradle-${gradle_version} ${gradle_install_path}
|
||||
|
||||
# Install Kotlin/Native through the bootstrap Gradle project:
|
||||
COPY ./build.gradle.kts ./
|
||||
RUN mkdir ${konan_data_dir}
|
||||
RUN KONAN_DATA_DIR=${konan_data_dir} ${gradle_install_path}/bin/gradle model
|
||||
|
||||
# For login shells (ex: docker attach <hash>):
|
||||
RUN echo '#!/bin/sh' > /etc/profile.d/konan.sh
|
||||
RUN echo "export KONAN_DATA_DIR=${konan_data_dir}" >> /etc/profile.d/konan.sh
|
||||
RUN echo "export PATH=\$PATH:`ls -1d ${konan_data_dir}/kotlin-native-*/ | head -n 1`bin" >> /etc/profile.d/konan.sh
|
||||
RUN chmod +x /etc/profile.d/konan.sh
|
||||
|
||||
# For non-login shells (ex: docker exec -it <hash> bash):
|
||||
RUN echo '. /etc/profile.d/konan.sh' > /root/.bashrc
|
||||
|
||||
RUN rm -rf /tmp/*
|
||||
WORKDIR /root
|
||||
|
||||
ENTRYPOINT /bin/bash
|
||||
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.3.20"
|
||||
}
|
||||
|
||||
kotlin {
|
||||
linuxX64()
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
# Docker file to create an environment for building/testing samples.
|
||||
#
|
||||
# To build new image use
|
||||
# docker build -t docker-registry.labs.intellij.net/kotlin-native/samples-environment:3 .
|
||||
#
|
||||
# To publish image to the JB internal registry use
|
||||
# docker push docker-registry.labs.intellij.net/kotlin-native/samples-environment:3
|
||||
|
||||
FROM ubuntu
|
||||
|
||||
ENV adt_download_url=https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
|
||||
ENV adt_platform="platforms;android-28"
|
||||
ENV adt_build_tools="build-tools;28.0.3"
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y upgrade
|
||||
RUN apt-get -y install sudo wget curl unzip cmake git libgit2-dev libcurl4-gnutls-dev libgtk-3-dev freeglut3-dev libsdl2-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
# Install JDK 8:
|
||||
RUN apt-get -y install openjdk-8-jdk
|
||||
|
||||
# Install Android SDK:
|
||||
RUN wget ${adt_download_url}
|
||||
RUN unzip sdk-tools-*.zip -d /opt/adt
|
||||
RUN yes | /opt/adt/tools/bin/sdkmanager "${adt_platform}" "${adt_build_tools}"
|
||||
|
||||
# Install Python:
|
||||
RUN apt-get -y install python-pip python-dev build-essential
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --upgrade virtualenv
|
||||
RUN pip -q install pyyaml typing
|
||||
|
||||
RUN rm -rf /tmp/*
|
||||
WORKDIR /root
|
||||
@@ -0,0 +1,51 @@
|
||||
# Docker file to create an environment for building/testing samples.
|
||||
#
|
||||
# To build new image use
|
||||
# docker build -t docker-registry.labs.intellij.net/kotlin-native/samples-environment:3 .
|
||||
#
|
||||
# To publish image to the JB internal registry use
|
||||
# docker push docker-registry.labs.intellij.net/kotlin-native/samples-environment:3
|
||||
|
||||
FROM ubuntu
|
||||
|
||||
ENV jdk_download_url=https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
|
||||
ENV jdk_install_path=/opt/jdk
|
||||
ENV adt_download_url=https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
|
||||
ENV adt_platform="platforms;android-28"
|
||||
ENV adt_build_tools="build-tools;28.0.3"
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y upgrade
|
||||
RUN apt-get -y install sudo wget curl unzip cmake git libgit2-dev libcurl4-gnutls-dev libgtk-3-dev freeglut3-dev libsdl2-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
# Obtain the freshest CA certs bundle from the latest available JDK.
|
||||
# Need it because newer CA certs will allow making SSL handshakes to AWS-hosted hosts such as https://downloads.jetbrains.com.
|
||||
RUN apt-get -y install default-jdk
|
||||
RUN update-alternatives --list java | sed 's/\/bin\/java$//' | xargs -I %% cp %%/lib/security/cacerts ./
|
||||
RUN apt-get -y purge --auto-remove default-jdk
|
||||
|
||||
# Install non-LTS JDK:
|
||||
RUN wget ${jdk_download_url}
|
||||
RUN tar -xzf openjdk-*.tar.gz
|
||||
RUN mv ./jdk* ${jdk_install_path}
|
||||
# use newer CA certs:
|
||||
RUN mv ${jdk_install_path}/lib/security/cacerts ${jdk_install_path}/lib/security/cacerts.orig
|
||||
RUN cp ./cacerts ${jdk_install_path}/lib/security/
|
||||
RUN update-alternatives --install /usr/bin/java java ${jdk_install_path}/bin/java 1
|
||||
RUN update-alternatives --install /usr/bin/javac javac ${jdk_install_path}/bin/javac 1
|
||||
|
||||
# Install Android SDK:
|
||||
RUN wget ${adt_download_url}
|
||||
RUN unzip sdk-tools-*.zip -d /opt/adt
|
||||
RUN yes | /opt/adt/tools/bin/sdkmanager "${adt_platform}" "${adt_build_tools}"
|
||||
|
||||
# Install Python:
|
||||
RUN apt-get -y install python-pip python-dev build-essential
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --upgrade virtualenv
|
||||
RUN pip -q install pyyaml typing
|
||||
|
||||
RUN rm -rf /tmp/*
|
||||
WORKDIR /root
|
||||
Reference in New Issue
Block a user