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
|
2024-09-03 16:05:06 +00:00
|
|
|
FROM mcr.microsoft.com/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
|
|
|
|
|
2021-05-26 09:01:25 +00:00
|
|
|
# With the User Change, we need to change permissions on these directories
|
2015-11-17 08:45:49 +00:00
|
|
|
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}
|
|
|
|
|
2019-09-10 19:33:20 +00:00
|
|
|
# Set working directory
|
|
|
|
ARG WORK_DIR
|
|
|
|
WORKDIR ${WORK_DIR}
|