|
| 1 | +FROM mcr.microsoft.com/dotnet/sdk:5.0 |
| 2 | + |
| 3 | +# [Option] Install zsh |
| 4 | +ARG INSTALL_ZSH="true" |
| 5 | +# [Option] Upgrade OS packages to their latest versions |
| 6 | +ARG UPGRADE_PACKAGES="false" |
| 7 | +# [Option] Enable non-root Docker access in container |
| 8 | +ARG ENABLE_NONROOT_DOCKER="true" |
| 9 | +# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine |
| 10 | +ARG USE_MOBY="true" |
| 11 | + |
| 12 | +# Install needed packages and setup non-root user. Use a separate RUN statement to add your |
| 13 | +# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists. |
| 14 | +ARG USERNAME=automatic |
| 15 | +ARG USER_UID=1000 |
| 16 | +ARG USER_GID=$USER_UID |
| 17 | +COPY library-scripts/*.sh /tmp/library-scripts/ |
| 18 | +RUN apt-get update \ |
| 19 | + && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ |
| 20 | + # Use Docker script from script library to set things up |
| 21 | + && /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" \ |
| 22 | + # Clean up |
| 23 | + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/ |
| 24 | + |
| 25 | +VOLUME [ "/var/lib/docker" ] |
| 26 | + |
| 27 | +# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine |
| 28 | +# inside the container "overrideCommand": false is set in devcontainer.json. |
| 29 | +# The script will also execute CMD if you need to alter startup behaviors. |
| 30 | +ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] |
| 31 | +CMD [ "sleep", "infinity" ] |
| 32 | + |
| 33 | +# Instructions to install latest Mono from |
| 34 | +# https://www.mono-project.com/download/stable/#download-lin-debian |
| 35 | +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ |
| 36 | + echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \ |
| 37 | + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
| 38 | + mono-complete |
| 39 | + |
| 40 | +# Instructions to install .NET Core runtimes from |
| 41 | +# https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-debian10 |
| 42 | +RUN wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ |
| 43 | + dpkg -i packages-microsoft-prod.deb && \ |
| 44 | + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
| 45 | + apt-transport-https \ |
| 46 | + aspnetcore-runtime-2.1 \ |
| 47 | + aspnetcore-runtime-3.0 \ |
| 48 | + aspnetcore-runtime-3.1 |
| 49 | + |
| 50 | +# [Optional] Uncomment this section to install additional OS packages. |
| 51 | +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
| 52 | +# && apt-get -y install --no-install-recommends <your-package-list-here> |
0 commit comments