2015-11-16 19:21:57 +00: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 16:05:17 +00:00
|
|
|
# Dockerfile that creates a container suitable to build dotnet-cli
|
2018-10-17 22:17:40 +00:00
|
|
|
FROM microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
|
2015-10-20 16:05:17 +00:00
|
|
|
|
2016-01-08 02:50:00 +00:00
|
|
|
RUN yum -q -y install sudo
|
2015-11-17 08:45:49 +00:00
|
|
|
|
|
|
|
# Setup User to match Host User, and give superuser permissions
|
|
|
|
ARG USER_ID=0
|
2016-01-08 02:50:00 +00:00
|
|
|
RUN useradd -m code_executor -u ${USER_ID} -g root
|
2015-11-17 08:45:49 +00: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
|
2016-01-08 02:50:00 +00:00
|
|
|
RUN chmod -R 755 /usr/bin/sudo
|
2015-11-17 08:45:49 +00:00
|
|
|
|
|
|
|
# Set user to the one we just created
|
|
|
|
USER ${USER_ID}
|
|
|
|
|
2015-10-20 16:05:17 +00:00
|
|
|
# Set working directory
|
|
|
|
WORKDIR /opt/code
|