зеркало из https://github.com/microsoft/Oryx.git
Williamhe/1562986 add vso bullseye image (#1554)
* Add vso bullseye image
* Add integration test
* Add vso bullseye Dockerfile
* Revert vso docal dockerfile
* Revert vso docal dockerfile
* Resolve conflicts
* Resolve conflicts
* Resolve conflicts
* Revert "Resolve conflicts"
This reverts commit 2079491b9c
.
* Add bullseye php 8.0.22
* Update vso image category test
* Update vso image name
* Update to cleanup Dockerfile
* Update test with building sdk from storage account
* Update with cleanup
* locked in the sys unix package to resolve pipeline failures
* Remove unnecessary commands
Co-authored-by: Paul Dorsch <pauldorsch@microsoft.com>
This commit is contained in:
Родитель
ab1dd05220
Коммит
e09fe40307
|
@ -34,6 +34,7 @@ declare -r BUILD_IMAGES_FULL_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/full
|
|||
declare -r BUILD_IMAGES_AZ_FUNCS_JAMSTACK_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/azureFunctions.JamStack.Dockerfile"
|
||||
declare -r BUILD_IMAGES_GITHUB_ACTIONS_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/gitHubActions.Dockerfile"
|
||||
declare -r BUILD_IMAGES_VSO_FOCAL_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/vso.focal.Dockerfile"
|
||||
declare -r BUILD_IMAGES_VSO_BULLSEYE_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/vso.bullseye.Dockerfile"
|
||||
declare -r BUILD_IMAGES_BUILDSCRIPTGENERATOR_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/buildScriptGenerator.Dockerfile"
|
||||
declare -r BUILD_IMAGES_SUPPORT_FILES_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/supportFilesForBuildingBuildImages.Dockerfile"
|
||||
declare -r BUILD_IMAGES_GITHUB_RUNNERS_BUILDPACKDEPS_STRETCH_DOCKERFILE="$REPO_DIR/images/build/Dockerfiles/gitHubRunners.BuildPackDepsStretch.Dockerfile"
|
||||
|
@ -75,6 +76,7 @@ declare -r ACR_BUILD_FULL_IMAGE_NAME="$ACR_BUILD_IMAGES_REPO:full"
|
|||
declare -r ACR_BUILD_LTS_VERSIONS_IMAGE_NAME="$ACR_BUILD_IMAGES_REPO:lts-versions"
|
||||
declare -r ACR_BUILD_GITHUB_ACTIONS_IMAGE_NAME="$ACR_BUILD_IMAGES_REPO:github-actions"
|
||||
declare -r ACR_BUILD_VSO_FOCAL_IMAGE_NAME="$ACR_BUILD_IMAGES_REPO:vso-ubuntu-focal"
|
||||
declare -r ACR_BUILD_VSO_BULLSEYE_IMAGE_NAME="$ACR_BUILD_IMAGES_REPO:vso-debian-bullseye"
|
||||
|
||||
declare -r BASE_IMAGES_REPO="$ACR_DEV_NAME/public/oryx/base"
|
||||
|
||||
|
|
|
@ -360,19 +360,32 @@ function buildLatestImages() {
|
|||
.
|
||||
}
|
||||
|
||||
function buildVsoFocalImage() {
|
||||
function buildVsoImage() {
|
||||
buildBuildScriptGeneratorImage
|
||||
buildGitHubRunnersUbuntuBaseImage
|
||||
local debianFlavor=$1
|
||||
if [ -z "$debianFlavor" ] || [ "$debianFlavor" == "focal" ]; then
|
||||
BUILD_IMAGE=$BUILD_IMAGES_VSO_FOCAL_DOCKERFILE
|
||||
local builtImageName="$ACR_BUILD_VSO_FOCAL_IMAGE_NAME"
|
||||
local tagName="vso-ubuntu-focal"
|
||||
elif [ "$debianFlavor" == "bullseye" ]; then
|
||||
BUILD_IMAGE=$BUILD_IMAGES_VSO_BULLSEYE_DOCKERFILE
|
||||
local builtImageName="$ACR_BUILD_VSO_BULLSEYE_IMAGE_NAME"
|
||||
local tagName="vso-debian-bullseye"
|
||||
else
|
||||
echo "Unsupported VSO image Debian flavor."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BuildAndTagStage "$BUILD_IMAGES_VSO_FOCAL_DOCKERFILE" intermediate
|
||||
BuildAndTagStage "$BUILD_IMAGE" intermediate
|
||||
echo
|
||||
echo "-------------Creating VSO focal build image-------------------"
|
||||
local builtImageName="$ACR_BUILD_VSO_FOCAL_IMAGE_NAME"
|
||||
echo "-------------Creating VSO $debianFlavor build image-------------------"
|
||||
|
||||
docker build -t $builtImageName \
|
||||
--build-arg AI_KEY=$APPLICATION_INSIGHTS_INSTRUMENTATION_KEY \
|
||||
--build-arg SDK_STORAGE_BASE_URL_VALUE=$sdkStorageAccountUrl \
|
||||
--build-arg SDK_STORAGE_BASE_URL_VALUE=$PROD_SDK_CDN_STORAGE_BASE_URL \
|
||||
--label com.microsoft.oryx="$labelContent" \
|
||||
-f "$BUILD_IMAGES_VSO_FOCAL_DOCKERFILE" \
|
||||
-f "$BUILD_IMAGE" \
|
||||
.
|
||||
|
||||
createImageNameWithReleaseTag $builtImageName
|
||||
|
@ -381,7 +394,10 @@ function buildVsoFocalImage() {
|
|||
echo "$builtImageName image history"
|
||||
docker history $builtImageName
|
||||
|
||||
docker tag $builtImageName "$DEVBOX_BUILD_IMAGES_REPO:vso-ubuntu-focal"
|
||||
docker tag $builtImageName "$DEVBOX_BUILD_IMAGES_REPO:$tagName"
|
||||
|
||||
echo
|
||||
echo "$builtImageName" >> $ACR_BUILD_IMAGES_ARTIFACTS_FILE
|
||||
}
|
||||
|
||||
function buildCliImage() {
|
||||
|
@ -476,7 +492,8 @@ if [ -z "$imageTypeToBuild" ]; then
|
|||
buildLtsVersionsImage "buster"
|
||||
buildLtsVersionsImage
|
||||
buildLatestImages
|
||||
buildVsoFocalImage
|
||||
buildVsoImage "focal"
|
||||
buildVsoImage "bullseye"
|
||||
buildCliImage "buster"
|
||||
buildCliImage
|
||||
buildBuildPackImage
|
||||
|
@ -513,7 +530,9 @@ elif [ "$imageTypeToBuild" == "full" ]; then
|
|||
buildFullImage "bullseye"
|
||||
buildFullImage "buster"
|
||||
elif [ "$imageTypeToBuild" == "vso-focal" ]; then
|
||||
buildVsoFocalImage
|
||||
buildVsoImage "focal"
|
||||
elif [ "$imageTypeToBuild" == "vso-bullseye" ]; then
|
||||
buildVsoImage "bullseye"
|
||||
elif [ "$imageTypeToBuild" == "cli" ]; then
|
||||
buildCliImage
|
||||
buildCliImage "buster"
|
||||
|
|
|
@ -9,8 +9,8 @@ set -e
|
|||
oryxImageDetectorFile="/opt/oryx/.imagetype"
|
||||
SYMLINK_DIRECTORY_NAME=""
|
||||
|
||||
if [ -f "$oryxImageDetectorFile" ] && grep -q "vso-focal" "$oryxImageDetectorFile"; then
|
||||
echo "image detector file exists, image is vso-focal based.."
|
||||
if [ -f "$oryxImageDetectorFile" ] && grep -q "vso-" "$oryxImageDetectorFile"; then
|
||||
echo "image detector file exists, image is vso based.."
|
||||
SYMLINK_DIRECTORY_NAME="codespace"
|
||||
fi
|
||||
|
||||
|
|
|
@ -0,0 +1,286 @@
|
|||
FROM mcr.microsoft.com/mirror/docker/library/buildpack-deps:bullseye AS main
|
||||
|
||||
# Install basic build tools
|
||||
# Configure locale (required for Python)
|
||||
# NOTE: Do NOT move it from here as it could have global implications
|
||||
RUN LANG="C.UTF-8" \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
make \
|
||||
unzip \
|
||||
# The tools in this package are used when installing packages for Python
|
||||
build-essential \
|
||||
# Required for Microsoft SQL Server
|
||||
unixodbc-dev \
|
||||
# Required for PostgreSQL
|
||||
libpq-dev \
|
||||
# Required for mysqlclient
|
||||
default-libmysqlclient-dev \
|
||||
# Required for ts
|
||||
moreutils \
|
||||
rsync \
|
||||
zip \
|
||||
libgdiplus \
|
||||
jq \
|
||||
# By default pip is not available in the buildpacks image
|
||||
python-pip-whl \
|
||||
python3-pip \
|
||||
#.NET Core related pre-requisites
|
||||
libc6 \
|
||||
libgcc1 \
|
||||
libgssapi-krb5-2 \
|
||||
libncurses5 \
|
||||
liblttng-ust0 \
|
||||
libssl-dev \
|
||||
libstdc++6 \
|
||||
zlib1g \
|
||||
libuuid1 \
|
||||
libunwind8 \
|
||||
sqlite3 \
|
||||
libsqlite3-dev \
|
||||
software-properties-common \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
# This is the folder containing 'links' to benv and build script generator
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install -y --no-install-recommends python2 \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& pip3 install pip --upgrade \
|
||||
&& mkdir -p /opt/oryx
|
||||
|
||||
# NOTE: Place only folders whose size does not extrememly effect the perf of building this image
|
||||
# since this intermediate stage is copied to final stage.
|
||||
# For example, if we put yarn-cache here it is going to impact perf since it more than 500MB
|
||||
FROM main AS intermediate
|
||||
COPY --from=oryxdevmcr.azurecr.io/private/oryx/support-files-image-for-build /tmp/oryx/ /opt/tmp
|
||||
COPY --from=oryxdevmcr.azurecr.io/private/oryx/buildscriptgenerator /opt/buildscriptgen/ /opt/buildscriptgen/
|
||||
|
||||
FROM main AS final
|
||||
ARG AI_KEY
|
||||
ARG SDK_STORAGE_BASE_URL_VALUE
|
||||
|
||||
# add an environment variable to determine debian_flavor
|
||||
# to correctly download platform sdk during platform installation
|
||||
ENV DEBIAN_FLAVOR="bullseye"
|
||||
|
||||
COPY --from=intermediate /opt /opt
|
||||
|
||||
# Docker has an issue with variable expansion when all are used in a single ENV command.
|
||||
# For example here the $LASTNAME in the following example does not expand to JORDAN but instead is empty:
|
||||
# ENV LASTNAME="JORDAN" \
|
||||
# NAME="MICHAEL $LASTNAME"
|
||||
#
|
||||
# Even though this adds a new docker layer we are doing this
|
||||
# because we want to avoid duplication (which is always error-prone)
|
||||
|
||||
RUN set -ex \
|
||||
&& tmpDir="/opt/tmp" \
|
||||
&& imagesDir="$tmpDir/images" \
|
||||
&& buildDir="$tmpDir/build" \
|
||||
# https://github.com/docker-library/python/issues/147
|
||||
&& PYTHONIOENCODING="UTF-8" \
|
||||
# new next line
|
||||
&& add-apt-repository --remove ppa:xapienz/curl34 \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
# It's not clear whether these are needed at runtime...
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
tk-dev \
|
||||
uuid-dev \
|
||||
gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
# Install .NET Core SDKs
|
||||
&& nugetPackagesDir="/var/nuget" \
|
||||
&& mkdir -p $nugetPackagesDir \
|
||||
# Grant read-write permissions to the nuget folder so that dotnet restore
|
||||
# can write into it.
|
||||
&& chmod a+rw $nugetPackagesDir \
|
||||
&& DOTNET_RUNNING_IN_CONTAINER=true \
|
||||
&& DOTNET_USE_POLLING_FILE_WATCHER=true \
|
||||
&& NUGET_XMLDOC_MODE=skip \
|
||||
&& DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \
|
||||
&& NUGET_PACKAGES="$nugetPackagesDir" \
|
||||
&& . $buildDir/__dotNetCoreSdkVersions.sh \
|
||||
&& DOTNET_SDK_VER=$DOT_NET_CORE_31_SDK_VERSION \
|
||||
INSTALL_PACKAGES="true" \
|
||||
$imagesDir/build/installDotNetCore.sh \
|
||||
&& DOTNET_SDK_VER=$DOT_NET_60_SDK_VERSION \
|
||||
INSTALL_PACKAGES="true" \
|
||||
$imagesDir/build/installDotNetCore.sh \
|
||||
&& rm -rf /tmp/NuGetScratch \
|
||||
&& find $nugetPackagesDir -type d -exec chmod 777 {} \; \
|
||||
&& cd /opt/dotnet \
|
||||
&& . $buildDir/__dotNetCoreSdkVersions.sh \
|
||||
&& ln -s $DOT_NET_CORE_31_SDK_VERSION 3-lts \
|
||||
&& ln -s $DOT_NET_60_SDK_VERSION 6-lts \
|
||||
&& ln -s $DOT_NET_60_SDK_VERSION lts \
|
||||
# Install Hugo
|
||||
&& mkdir -p /home/codespace/.hugo \
|
||||
&& $imagesDir/build/installHugo.sh \
|
||||
# Install Node
|
||||
&& mkdir -p /home/codespace/.nodejs \
|
||||
&& . $buildDir/__nodeVersions.sh \
|
||||
&& $imagesDir/installPlatform.sh nodejs $NODE14_VERSION \
|
||||
&& $imagesDir/installPlatform.sh nodejs $NODE16_VERSION \
|
||||
&& $imagesDir/receiveGpgKeys.sh 6A010C5166006599AA17F08146C2130DFD2497F5 \
|
||||
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
|
||||
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
|
||||
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
|
||||
&& mkdir -p /opt/yarn \
|
||||
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn \
|
||||
&& mv /opt/yarn/yarn-v$YARN_VERSION /opt/yarn/$YARN_VERSION \
|
||||
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
|
||||
&& cd /opt/nodejs \
|
||||
&& ln -s $NODE14_VERSION 14 \
|
||||
&& ln -s $NODE16_VERSION 16 \
|
||||
&& ln -s $NODE16_VERSION lts \
|
||||
&& ln -sfn /opt/nodejs/$NODE16_VERSION /home/codespace/.nodejs/current \
|
||||
&& cd /opt/yarn \
|
||||
&& ln -s $YARN_VERSION stable \
|
||||
&& ln -s $YARN_VERSION latest \
|
||||
&& ln -s $YARN_VERSION $YARN_MINOR_VERSION \
|
||||
&& ln -s $YARN_MINOR_VERSION $YARN_MAJOR_VERSION \
|
||||
# Install Python SDKs
|
||||
# Upgrade system python
|
||||
&& mkdir -p /home/codespace/.python \
|
||||
&& pip install --upgrade cython \
|
||||
&& pip3 install --upgrade cython \
|
||||
&& . $buildDir/__pythonVersions.sh \
|
||||
&& $imagesDir/installPlatform.sh python $PYTHON39_VERSION \
|
||||
&& $imagesDir/installPlatform.sh python $PYTHON310_VERSION \
|
||||
&& [ -d "/opt/python/$PYTHON39_VERSION" ] && echo /opt/python/$PYTHON39_VERSION/lib >> /etc/ld.so.conf.d/python.conf \
|
||||
&& [ -d "/opt/python/$PYTHON310_VERSION" ] && echo /opt/python/$PYTHON310_VERSION/lib >> /etc/ld.so.conf.d/python.conf \
|
||||
&& ldconfig \
|
||||
&& cd /opt/python \
|
||||
&& ln -s $PYTHON39_VERSION 3.9 \
|
||||
&& ln -s $PYTHON310_VERSION 3.10 \
|
||||
&& ln -s $PYTHON310_VERSION latest \
|
||||
&& ln -s $PYTHON310_VERSION stable \
|
||||
&& ln -s $PYTHON310_VERSION 3 \
|
||||
&& ln -sfn /opt/python/$PYTHON310_VERSION /home/codespace/.python/current \
|
||||
# Install PHP pre-reqs
|
||||
&& $imagesDir/build/php/prereqs/installPrereqs.sh \
|
||||
&& mkdir -p /home/codespace/.php \
|
||||
# Copy PHP versions
|
||||
&& . $buildDir/__phpVersions.sh \
|
||||
&& $imagesDir/installPlatform.sh php $PHP80_VERSION \
|
||||
&& $imagesDir/installPlatform.sh php $PHP81_VERSION \
|
||||
&& $imagesDir/installPlatform.sh php-composer $COMPOSER2_3_VERSION \
|
||||
&& cd /opt/php \
|
||||
&& ln -s $PHP81_VERSION 8 \
|
||||
&& ln -s $PHP81_VERSION lts \
|
||||
&& ln -sfn /opt/php/$PHP81_VERSION /home/codespace/.php/current \
|
||||
&& cd /opt/php-composer \
|
||||
&& ln -sfn $COMPOSER2_3_VERSION stable \
|
||||
&& ln -sfn /opt/php-composer/stable/composer.phar /opt/php-composer/composer.phar \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
libargon2-0 \
|
||||
libonig-dev \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& cp -f $imagesDir/build/benv.sh /opt/oryx/benv \
|
||||
&& cp -f $imagesDir/build/logger.sh /opt/oryx/logger \
|
||||
&& mkdir -p /usr/local/share/pip-cache/lib \
|
||||
&& chmod -R 777 /usr/local/share/pip-cache \
|
||||
&& ln -s /opt/buildscriptgen/GenerateBuildScript /opt/oryx/oryx \
|
||||
&& rm -f /etc/apt/sources.list.d/buster.list
|
||||
|
||||
ENV ORYX_PATHS="/opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts::/opt/java/lts/bin:/opt/maven/lts/bin:/opt/ruby/lts/bin"
|
||||
|
||||
ENV ORYX_PREFER_USER_INSTALLED_SDKS=true \
|
||||
ORIGINAL_PATH="$PATH" \
|
||||
PATH="$ORYX_PATHS:$PATH" \
|
||||
CONDA_SCRIPT="/opt/conda/etc/profile.d/conda.sh" \
|
||||
RUBY_HOME="/opt/ruby/lts" \
|
||||
JAVA_HOME="/opt/java/lts" \
|
||||
DYNAMIC_INSTALL_ROOT_DIR="/opt"
|
||||
|
||||
# Now adding remaining of VSO platform features
|
||||
RUN buildDir="/opt/tmp/build" \
|
||||
&& imagesDir="/opt/tmp/images" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
apt-transport-https \
|
||||
nano \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg \
|
||||
&& install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg \
|
||||
&& gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 \
|
||||
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list \
|
||||
&& . $buildDir/__condaConstants.sh \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
conda=${CONDA_VERSION} \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& echo $$CONDA_SCRIPT \
|
||||
&&. $CONDA_SCRIPT \
|
||||
&& conda config --add channels conda-forge \
|
||||
&& conda config --set channel_priority strict \
|
||||
&& conda config --set env_prompt '({name})' \
|
||||
&& echo "source ${CONDA_SCRIPT}" >> ~/.bashrc \
|
||||
&& condaDir="/opt/oryx/conda" \
|
||||
&& mkdir -p "$condaDir" \
|
||||
&& cd $imagesDir/build/python/conda \
|
||||
&& cp -rf * "$condaDir" \
|
||||
&& cd $imagesDir \
|
||||
&& mkdir -p /home/codespace/.ruby \
|
||||
&& . $buildDir/__rubyVersions.sh \
|
||||
&& ./installPlatform.sh ruby $RUBY30_VERSION \
|
||||
&& ./installPlatform.sh ruby $RUBY31_VERSION \
|
||||
&& cd /opt/ruby \
|
||||
&& ln -s $RUBY30_VERSION /opt/ruby/lts \
|
||||
&& ln -sfn /opt/ruby/$RUBY30_VERSION /home/codespace/.ruby/current \
|
||||
&& cd $imagesDir \
|
||||
&& mkdir -p /home/codespace/.java \
|
||||
&& . $buildDir/__javaVersions.sh \
|
||||
&& ./installPlatform.sh java $JAVA_VERSION \
|
||||
&& ./installPlatform.sh java $JAVA_VERSION11 \
|
||||
&& ./installPlatform.sh maven $MAVEN_VERSION \
|
||||
&& cd /opt/java \
|
||||
&& ln -s $JAVA_VERSION lts \
|
||||
&& ln -sfn /opt/java/$JAVA_VERSION /home/codespace/.java/current \
|
||||
&& cd /opt/maven \
|
||||
&& ln -s $MAVEN_VERSION lts \
|
||||
&& mkdir -p /home/codespace/.maven/current \
|
||||
&& ln -sfn /opt/maven/$MAVEN_VERSION /home/codespace/.maven/current \
|
||||
&& npm install -g lerna@4.0.0 \
|
||||
&& PATH="$PATH:/opt/php/lts/bin" \
|
||||
&& wget http://pear.php.net/go-pear.phar \
|
||||
&& php go-pear.phar \
|
||||
&& pecl version \
|
||||
&& pecl install -f libsodium \
|
||||
&& echo "vso-debian-bullseye" > /opt/oryx/.imagetype \
|
||||
&& echo "DEBIAN|${DEBIAN_FLAVOR}" | tr '[a-z]' '[A-Z]' > /opt/oryx/.ostype
|
||||
|
||||
# install few more tools for VSO
|
||||
RUN gem install bundler rake --backtrace
|
||||
RUN apt-get update \
|
||||
&& apt-get install jekyll -y --no-install-recommends
|
||||
RUN yes | pecl install xdebug \
|
||||
&& export PHP_LOCATION=$(dirname $(dirname $(which php))) \
|
||||
&& echo "zend_extension=$(find ${PHP_LOCATION}/lib/php/extensions/ -name xdebug.so)" > ${PHP_LOCATION}/ini/conf.d/xdebug.ini \
|
||||
&& echo "xdebug.mode = debug" >> ${PHP_LOCATION}/ini/conf.d/xdebug.ini \
|
||||
&& echo "xdebug.start_with_request = yes" >> ${PHP_LOCATION}/ini/conf.d/xdebug.ini \
|
||||
&& echo "xdebug.client_port = 9000" >> ${PHP_LOCATION}/ini/conf.d/xdebug.ini
|
||||
|
||||
RUN ./opt/tmp/build/createSymlinksForDotnet.sh
|
||||
|
||||
RUN groupadd -g 1000 codespace
|
||||
RUN useradd -u 1000 -g codespace codespace
|
||||
RUN chown -R codespace:codespace /home/codespace/
|
||||
RUN chown -R codespace:codespace /opt/
|
||||
|
||||
ENV NUGET_XMLDOC_MODE="skip" \
|
||||
# VSO requires user installed tools to be preferred over Oryx installed tools
|
||||
PATH="$ORIGINAL_PATH:$ORYX_PATHS" \
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE="1" \
|
||||
NUGET_PACKAGES="/var/nuget" \
|
||||
ORYX_SDK_STORAGE_BASE_URL="${SDK_STORAGE_BASE_URL_VALUE}" \
|
||||
ENABLE_DYNAMIC_INSTALL="true" \
|
||||
ORYX_PREFER_USER_INSTALLED_SDKS=true \
|
||||
ORYX_AI_INSTRUMENTATION_KEY=${AI_KEY} \
|
||||
PYTHONIOENCODING="UTF-8"
|
||||
|
||||
ENTRYPOINT [ "benv" ]
|
|
@ -22,9 +22,10 @@ PHPIZE_DEPS="autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c"
|
|||
# libcurl3 and libcurl4 both needs to be supported in ubuntu focal for php
|
||||
# https://github.com/xapienz/curl-debian-scripts
|
||||
add-apt-repository ppa:xapienz/curl34 -y \
|
||||
&& apt-get update \
|
||||
apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install -y \
|
||||
sed \
|
||||
$PHPIZE_DEPS \
|
||||
ca-certificates \
|
||||
curl \
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
7.4.28, 9cc3b6f6217b60582f78566b3814532c4b71d517876c25013ae51811e65d8fce, 42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312,
|
||||
7.4.30, ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d, 42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312,
|
||||
|
||||
8.0.22, 130937c0fa3050cd33d6c415402f6ccbf0682ae83eb8d39c91164224ddfe57f1, 1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F,
|
||||
8.1.0, a1317eff0723a2b3d3122bbfe107a1158570ea2822dc35a5fb360086db0f6bbc, 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544,
|
||||
8.1.4, 05a8c0ac30008154fb38a305560543fc172ba79fb957084a99b8d3b10d5bdb4b, 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544,
|
||||
8.1.6, da38d65bb0d5dd56f711cd478204f2b62a74a2c2b0d2d523a78d6eb865b2364c, 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544,
|
||||
|
|
|
@ -206,7 +206,7 @@ npm pack
|
|||
|
||||
ReadImageType=$(cat /opt/oryx/.imagetype)
|
||||
|
||||
if [ "$ReadImageType" = "vso-focal" ]
|
||||
if [ "$ReadImageType" = "vso-focal" ] || [ "$ReadImageType" = "vso-debian-bullseye" ]
|
||||
then
|
||||
echo $ReadImageType
|
||||
cat "$COMMAND_MANIFEST_FILE"
|
||||
|
|
|
@ -153,33 +153,33 @@ namespace Microsoft.Oryx.BuildScriptGenerator
|
|||
.AppendLine("echo \"image detector file exists, platform is dotnet..\"")
|
||||
.AppendLine($"PATH=/opt/dotnet/{version}/dotnet:$PATH")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"dotnet\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"dotnet\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine("echo \"image detector file exists, platform is dotnet..\"")
|
||||
.AppendLine($"source /opt/tmp/build/createSymlinksForDotnet.sh")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"nodejs\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"nodejs\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine("echo \"image detector file exists, platform is nodejs..\"")
|
||||
.AppendLine($"mkdir -p /home/codespace/.nodejs")
|
||||
.AppendLine($"ln -sfn /opt/nodejs/{version} /home/codespace/.nodejs/current")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"php\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"php\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine("echo \"image detector file exists, platform is php..\"")
|
||||
.AppendLine($"mkdir -p /home/codespace/.php")
|
||||
.AppendLine($"ln -sfn /opt/php/{version} /home/codespace/.php/current")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"python\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"python\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine(" echo \"image detector file exists, platform is python..\"")
|
||||
.AppendLine($" [ -d \"/opt/python/$VERSION\" ] && echo /opt/python/{version}/lib >> /etc/ld.so.conf.d/python.conf")
|
||||
.AppendLine($" ldconfig")
|
||||
.AppendLine($" mkdir -p /home/codespace/.python")
|
||||
.AppendLine($" ln -sfn /opt/python/{version} /home/codespace/.python/current")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"java\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"java\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine("echo \"image detector file exists, platform is java..\"")
|
||||
.AppendLine($"mkdir -p /home/codespace/.java")
|
||||
.AppendLine($"ln -sfn /opt/java/{version} /home/codespace/.java/current")
|
||||
.AppendLine("fi")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"ruby\" ] && grep -q \"vso-focal\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine($"if [ -f \"$oryxImageDetectorFile\" ] && [ \"$platformName\" = \"ruby\" ] && grep -q \"vso-\" \"$oryxImageDetectorFile\"; then")
|
||||
.AppendLine("echo \"image detector file exists, platform is ruby..\"")
|
||||
.AppendLine($"mkdir -p /home/codespace/.ruby")
|
||||
.AppendLine($"ln -sfn /opt/ruby/{version} /home/codespace/.ruby/current")
|
||||
|
|
|
@ -53,7 +53,7 @@ echo "Done in $ELAPSED_TIME sec(s)."
|
|||
|
||||
ReadImageType=$(cat /opt/oryx/.imagetype)
|
||||
|
||||
if [ "$ReadImageType" = "vso-focal" ]
|
||||
if [ "$ReadImageType" = "vso-focal" ] || [ "$ReadImageType" = "vso-debian-bullseye" ]
|
||||
then
|
||||
echo $ReadImageType
|
||||
else
|
||||
|
|
|
@ -264,7 +264,7 @@ fi
|
|||
|
||||
ReadImageType=$(cat /opt/oryx/.imagetype)
|
||||
|
||||
if [ "$ReadImageType" = "vso-focal" ]
|
||||
if [ "$ReadImageType" = "vso-focal" ] || [ "$ReadImageType" = "vso-debian-bullseye" ]
|
||||
then
|
||||
echo $ReadImageType
|
||||
cat "$COMMAND_MANIFEST_FILE"
|
||||
|
|
|
@ -829,6 +829,43 @@ namespace Microsoft.Oryx.BuildImage.Tests
|
|||
result.GetDebugInfo());
|
||||
}
|
||||
|
||||
[Theory, Trait("category", "vso-bullseye")]
|
||||
[InlineData("flask-app")]
|
||||
[InlineData("django-realworld-example-app")]
|
||||
public void BuildPythonApps_AndHasLzmaModule(string appName)
|
||||
{
|
||||
// Arrange
|
||||
var volume = CreateSampleAppVolume(appName);
|
||||
var appDir = volume.ContainerDir;
|
||||
var appOutputDir = "/tmp/app1-output";
|
||||
var script = new ShellScriptBuilder()
|
||||
.SetEnvironmentVariable(
|
||||
SdkStorageConstants.SdkStorageBaseUrlKeyName,
|
||||
SdkStorageConstants.DevSdkStorageBaseUrl)
|
||||
.AddBuildCommand($"{appDir} -o {appOutputDir} --platform python --platform-version 3.10.4")
|
||||
.AddCommand($"python -V")
|
||||
.AddCommand($"python -c \"import lzma\"")
|
||||
.ToString();
|
||||
|
||||
// Act
|
||||
var result = _dockerCli.Run(new DockerRunArguments
|
||||
{
|
||||
ImageId = _imageHelper.GetVsoBuildImage("vso-debian-bullseye"),
|
||||
EnvironmentVariables = new List<EnvironmentVariable> { CreateAppNameEnvVar(appName) },
|
||||
Volumes = new List<DockerVolume> { volume },
|
||||
CommandToExecuteOnRun = "/bin/bash",
|
||||
CommandArguments = new[] { "-c", script }
|
||||
});
|
||||
|
||||
// Assert
|
||||
RunAsserts(
|
||||
() =>
|
||||
{
|
||||
Assert.True(result.IsSuccess);
|
||||
},
|
||||
result.GetDebugInfo());
|
||||
}
|
||||
|
||||
[Fact, Trait("category", "latest")]
|
||||
public void Build_VirtualEnv_Unzipped_ByDefault()
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
private const string _gitHubActionsBullseyeBaseWithEnv = ImageTestHelperConstants.GitHubActionsBullseyeBaseWithEnv;
|
||||
private const string _vso = ImageTestHelperConstants.Vso;
|
||||
private const string _vsoUbuntu = ImageTestHelperConstants.VsoFocal;
|
||||
private const string _vsoBullseye = ImageTestHelperConstants.VsoBullseye;
|
||||
private const string _buildRepository = ImageTestHelperConstants.BuildRepository;
|
||||
private const string _packRepository = ImageTestHelperConstants.PackRepository;
|
||||
private const string _cliRepository = ImageTestHelperConstants.CliRepository;
|
||||
|
@ -150,12 +151,12 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
public string GetRuntimeImage(string platformName, string platformVersion)
|
||||
{
|
||||
|
||||
if (PlatformVersionToOsType.TryGetValue(platformName, out var versionToOsType)
|
||||
if (PlatformVersionToOsType.TryGetValue(platformName, out var versionToOsType)
|
||||
&& versionToOsType.TryGetValue(platformVersion, out var osType))
|
||||
{
|
||||
return $"{_repoPrefix}/{platformName}:{platformVersion}-{osType}{_tagSuffix}";
|
||||
}
|
||||
|
||||
|
||||
return $"{_repoPrefix}/{platformName}:{platformVersion}{_tagSuffix}";
|
||||
}
|
||||
|
||||
|
@ -194,6 +195,10 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
{
|
||||
return GetVsoBuildImage(_vsoUbuntu);
|
||||
}
|
||||
else if (string.Equals(tag, _vsoBullseye))
|
||||
{
|
||||
return GetVsoBuildImage(_vsoBullseye);
|
||||
}
|
||||
else if (string.Equals(tag, _gitHubActionsStretch))
|
||||
{
|
||||
return GetGitHubActionsBuildImage();
|
||||
|
@ -263,26 +268,35 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
/// variable ORYX_TEST_TAG_SUFFIX, it will be used as the tag, otherwise, the 'latest' tag will be used.
|
||||
/// </summary>
|
||||
/// <returns>A 'build:slim' image that can be pulled for testing.</returns>
|
||||
public string GetAzureFunctionsJamStackBuildImage(string debianFlavor=null)
|
||||
public string GetAzureFunctionsJamStackBuildImage(string debianFlavor = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(debianFlavor)
|
||||
&& string.Equals(debianFlavor.ToLower(), _azureFunctionsJamStackBuster))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_azureFunctionsJamStackBuster}{_tagSuffix}";
|
||||
} else if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _azureFunctionsJamStackBullseye)) {
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _azureFunctionsJamStackBullseye))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_azureFunctionsJamStackBullseye}{_tagSuffix}";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_azureFunctionsJamStackStretch}{_tagSuffix}";
|
||||
}
|
||||
}
|
||||
|
||||
public string GetGitHubActionsBuildImage(string debianFlavor=null)
|
||||
public string GetGitHubActionsBuildImage(string debianFlavor = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _gitHubActionsBuster)) {
|
||||
if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _gitHubActionsBuster))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_gitHubActionsBuster}{_tagSuffix}";
|
||||
} else if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _gitHubActionsBullseye)) {
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _gitHubActionsBullseye))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_gitHubActionsBullseye}{_tagSuffix}";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_gitHubActionsStretch}{_tagSuffix}";
|
||||
}
|
||||
}
|
||||
|
@ -319,8 +333,13 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
}
|
||||
}
|
||||
|
||||
public string GetVsoBuildImage(string debianFlavor=null)
|
||||
public string GetVsoBuildImage(string debianFlavor = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(debianFlavor)
|
||||
&& string.Equals(debianFlavor.ToLower(), _vsoBullseye))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_vsoBullseye}{_tagSuffix}";
|
||||
}
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_vsoUbuntu}{_tagSuffix}";
|
||||
}
|
||||
|
||||
|
@ -377,7 +396,7 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
|
||||
return $"{_latestTag}-{_tagSuffix}";
|
||||
}
|
||||
|
||||
|
||||
private string GetFullBuildImage(string debianFlavor = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _fullBuster))
|
||||
|
@ -455,7 +474,7 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
};
|
||||
}
|
||||
|
||||
public static class ImageTestHelperConstants
|
||||
public static class ImageTestHelperConstants
|
||||
{
|
||||
public const string RepoPrefixEnvironmentVariable = "ORYX_TEST_IMAGE_BASE";
|
||||
public const string TagSuffixEnvironmentVariable = "ORYX_TEST_TAG_SUFFIX";
|
||||
|
@ -476,6 +495,7 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
public const string GitHubActionsBullseyeBaseWithEnv = "github-actions-debian-bullseye-base-withenv";
|
||||
public const string Vso = "vso";
|
||||
public const string VsoFocal = "vso-ubuntu-focal";
|
||||
public const string VsoBullseye = "vso-debian-bullseye";
|
||||
public const string BuildRepository = "build";
|
||||
public const string PackRepository = "pack";
|
||||
public const string CliRepository = "cli";
|
||||
|
@ -489,4 +509,4 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
public const string FullBuster = "full-debian-buster";
|
||||
public const string FullBullseye = "full-debian-bullseye";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,6 +23,9 @@ parameters:
|
|||
-
|
||||
key: VsoFocal
|
||||
value: vso-focal
|
||||
-
|
||||
key: VsoBullseye
|
||||
value: vso-bullseye
|
||||
-
|
||||
key: Full
|
||||
value: full
|
||||
|
|
|
@ -21,6 +21,9 @@ parameters:
|
|||
-
|
||||
key: VsoFocal
|
||||
value: vso-focal
|
||||
-
|
||||
key: VsoBullseye
|
||||
value: vso-bullseye
|
||||
-
|
||||
key: Full
|
||||
value: full
|
||||
|
|
|
@ -81,6 +81,7 @@ jobs:
|
|||
- Job_BuildImage_Jamstack
|
||||
- Job_BuildImage_GithubActions
|
||||
- Job_BuildImage_VsoFocal
|
||||
- Job_BuildImage_VsoBullseye
|
||||
- Job_BuildImage_Full
|
||||
- Job_BuildImage_Cli
|
||||
- Job_BuildImage_CliBuster
|
||||
|
|
|
@ -21,6 +21,9 @@ parameters:
|
|||
-
|
||||
key: VsoFocal
|
||||
value: vso-focal
|
||||
-
|
||||
key: VsoBullseye
|
||||
value: vso-bullseye
|
||||
-
|
||||
key: Full
|
||||
value: full
|
||||
|
|
|
@ -49,6 +49,7 @@ tagBuildImageForIntegrationTest "$imagefilter/build" "github-actions-debian-stre
|
|||
tagBuildImageForIntegrationTest "$imagefilter/build" "github-actions-debian-buster"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/build" "github-actions-debian-bullseye"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/build" "vso-ubuntu-focal"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/build" "vso-debian-bullseye"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/build" "full-debian-buster"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/cli" "debian-stretch"
|
||||
tagBuildImageForIntegrationTest "$imagefilter/cli-buster" "debian-buster"
|
||||
|
|
|
@ -56,6 +56,7 @@ tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:github-actions-debian-str
|
|||
tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:github-actions-debian-buster-$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" "github-actions-debian-buster" "github-actions-debian-buster-$RELEASE_TAG_NAME"
|
||||
tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:github-actions-debian-bullseye-$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" "github-actions-debian-bullseye" "github-actions-debian-bullseye-$RELEASE_TAG_NAME"
|
||||
tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:vso-ubuntu-focal-$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" "vso-ubuntu-focal" "vso-ubuntu-focal-$RELEASE_TAG_NAME"
|
||||
tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:vso-debian-bullseye-$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" "vso-debian-bullseye" "vso-debian-bullseye-$RELEASE_TAG_NAME"
|
||||
tagBuildImage "oryxdevmcr.azurecr.io/public/oryx/build:full-debian-buster-$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" "full-debian-buster" "full-debian-buster-$RELEASE_TAG_NAME"
|
||||
|
||||
echo "printing pme tags from $outPmeFileMCR"
|
||||
|
|
Загрузка…
Ссылка в новой задаче