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
|
2018-10-17 15:17:40 -07:00
|
|
|
FROM microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
|
2015-10-20 09:05:17 -07:00
|
|
|
|
2016-01-07 18:50:00 -08:00
|
|
|
RUN yum -q -y install sudo
|
2015-11-17 00:45:49 -08:00
|
|
|
|
|
|
|
# Setup User to match Host User, and give superuser permissions
|
|
|
|
ARG USER_ID=0
|
2016-01-07 18:50:00 -08:00
|
|
|
RUN useradd -m code_executor -u ${USER_ID} -g root
|
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
|
2016-01-07 18:50:00 -08:00
|
|
|
RUN chmod -R 755 /usr/bin/sudo
|
2015-11-17 00:45:49 -08:00
|
|
|
|
|
|
|
# Set user to the one we just created
|
|
|
|
USER ${USER_ID}
|
|
|
|
|
2019-09-10 12:33:20 -07:00
|
|
|
# Set working directory
|
|
|
|
ARG WORK_DIR
|
|
|
|
WORKDIR ${WORK_DIR}
|