2018-03-27 17:24:10 +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.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Dockerfile that creates a container suitable to build dotnet-cli
|
2021-07-09 20:56:01 +00:00
|
|
|
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-f90bc20-20180320154721
|
2018-03-27 17:24:10 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get -qqy install \
|
2018-06-28 04:40:29 +00:00
|
|
|
curl \
|
|
|
|
libcurl4 \
|
2022-05-24 17:31:29 +00:00
|
|
|
devscripts \
|
2022-05-24 18:29:53 +00:00
|
|
|
debhelper \
|
2018-03-27 17:24:10 +00:00
|
|
|
sudo && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# 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}
|
|
|
|
|
2019-09-10 19:33:20 +00:00
|
|
|
# Set working directory
|
|
|
|
ARG WORK_DIR
|
2021-07-09 20:56:01 +00:00
|
|
|
WORKDIR ${WORK_DIR}
|