Adding docker files, modifying scripts and code to handle ubuntu 16.04

This commit is contained in:
Livar Cunha 2016-05-26 12:48:16 -07:00
parent 2fb8656936
commit 84d1b60ffe
56 changed files with 178 additions and 12 deletions

View file

@ -23,7 +23,7 @@ export CHANNEL=$RELEASE_SUFFIX
#TODO this is a workaround for a nuget bug on ubuntu. Remove
export DISABLE_PARALLEL=""
[[ "$RID" =~ "ubuntu" ]] && export DISABLE_PARALLEL=""
[[ "$RID" =~ "ubuntu" -o "$RID" =~ "ubuntu.16.04" ]] && export DISABLE_PARALLEL=""
unset COMMONSOURCE
unset COMMONDIR

View file

@ -0,0 +1,63 @@
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
FROM ubuntu:16.04
# Install the base toolchain we need to build anything (clang, cmake, make and the like)
# this does not include libraries that we need to compile different projects, we'd like
# them in a different layer.
RUN apt-get update && \
apt-get install -y wget && \
echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list && \
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
apt-get update && \
apt-get install -y cmake \
make \
llvm-3.5 \
clang-3.5 \
lldb-3.6 \
lldb-3.6-dev && \
apt-get clean
# Install tools used by the VSO build automation. nodejs-legacy is a Debian specific
# package that provides `node' on the path (which azure cli needs).
RUN apt-get install -y git \
zip \
curl \
tar \
nodejs \
nodejs-legacy \
npm && \
apt-get clean && \
npm install -g azure-cli && \
npm cache clean
# Dependencies for CoreCLR and CoreFX
RUN apt-get install -y gettext \
libunwind8-dev \
libkrb5-dev \
libunwind8 \
libicu-dev \
liblttng-ust-dev \
libcurl4-openssl-dev \
libssl-dev \
uuid-dev && \
apt-get clean
# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo
# Set user to the one we just created
USER ${USER_ID}
# Set working directory
WORKDIR /opt/code

View file

@ -56,8 +56,14 @@ if [ -z "$DOCKERFILE" ]; then
echo "Defaulting to 'ubuntu' image for Darwin"
export DOCKERFILE=scripts/docker/ubuntu
elif [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
echo "Detected current OS as Ubuntu, using 'ubuntu' image"
export DOCKERFILE=scripts/docker/ubuntu
echo "Detected current OS as Ubuntu, determining ubuntu version to use..."
if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then
echo "using 'ubuntu.16.04' image"
export DOCKERFILE=scripts/docker/ubuntu.16.04
else
echo "using 'ubuntu' image"
export DOCKERFILE=scripts/docker/ubuntu
fi
elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then
echo "Detected current OS as CentOS, using 'centos' image"
export DOCKERFILE=scripts/docker/centos

View file

@ -66,6 +66,11 @@ get_current_os_name() {
else
# Detect Distro
if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then
echo "ubuntu.16.04"
return 0
fi
echo "ubuntu"
return 0
elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then