2015-11-16 11:21:57 -08:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
2015-10-20 09:05:17 -07:00
|
|
|
# Dockerfile that creates a container suitable to build dotnet-cli
|
2015-12-15 18:15:31 -08:00
|
|
|
FROM ubuntu:14.04
|
2015-10-20 09:05:17 -07:00
|
|
|
|
2015-10-29 10:02:14 -07:00
|
|
|
# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
|
2015-12-15 18:15:31 -08:00
|
|
|
# Install CoreCLR and CoreFx dependencies
|
2015-10-29 10:02:14 -07:00
|
|
|
RUN apt-get update && \
|
2015-12-15 18:15:31 -08:00
|
|
|
apt-get -qqy install unzip curl libicu-dev libunwind8 gettext libssl-dev libcurl3-gnutls zlib1g liblttng-ust-dev lldb-3.6-dev lldb-3.6
|
|
|
|
|
|
|
|
# Install Dotnet CLI dependencies.
|
|
|
|
# clang is required for dotnet-compile-native
|
|
|
|
RUN apt-get -qqy install clang-3.5
|
2015-10-21 23:41:38 -07:00
|
|
|
|
2015-10-21 15:21:14 -07:00
|
|
|
# Install Build Prereqs
|
2015-10-29 10:02:14 -07:00
|
|
|
RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list && \
|
|
|
|
curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
|
|
|
|
apt-get update && \
|
2015-12-15 18:15:31 -08:00
|
|
|
apt-get install -y debhelper build-essential devscripts git cmake
|
2015-10-21 15:21:14 -07:00
|
|
|
|
|
|
|
# Use clang as c++ compiler
|
2015-12-15 18:15:31 -08:00
|
|
|
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.5 100
|
|
|
|
RUN update-alternatives --set c++ /usr/bin/clang++-3.5
|
2015-10-20 09:05:17 -07:00
|
|
|
|
2015-11-17 00:45:49 -08:00
|
|
|
# Install azure cli. We need this to publish artifacts.
|
2015-11-10 17:49:33 -08:00
|
|
|
RUN apt-get -y install nodejs-legacy && \
|
|
|
|
apt-get -y install npm && \
|
2015-11-10 17:20:18 -08:00
|
|
|
npm install -g azure-cli
|
|
|
|
|
2015-11-17 00:45:49 -08:00
|
|
|
|
|
|
|
RUN apt-get install -qqy sudo
|
|
|
|
|
|
|
|
# Setup User to match Host User, and give superuser permissions
|
|
|
|
ARG USER_ID=0
|
2015-12-01 11:23:13 -08:00
|
|
|
RUN useradd -m code_executor -u ${USER_ID} -g sudo
|
2015-11-17 00:45:49 -08:00
|
|
|
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
|
|
|
|
|
|
|
# With the User Change, we need to change permssions 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}
|
|
|
|
|
2015-10-20 09:05:17 -07:00
|
|
|
# Set working directory
|
|
|
|
WORKDIR /opt/code
|