-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
29 lines (23 loc) · 1.33 KB
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Main variables required for the Docker layers
ARG MAIN_PROJECT_NAME=Hangman
ARG DOTNETCORE_VERSION=3.1
# Starting layer point using build image with dotnet SDK (very heavy image ~ 2GB)
FROM mcr.microsoft.com/dotnet/core/sdk:$DOTNETCORE_VERSION AS build-env
ARG MAIN_PROJECT_NAME
ARG DOTNETCORE_VERSION
WORKDIR /app
# Java for Sonar:
# 1. adds PPA software repository (bionic > main section) to the apt sources list (java)
# 2. downloads specific public key to verify and download the signed java package from PPA
# 3. adds yes to oracle license in order to auto yes the java install package
RUN echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main" | tee /etc/apt/sources.list.d/linuxuprising-java.list && \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A && apt-get update && \
echo oracle-java15-installer shared/accepted-oracle-license-v1-2 select true | /usr/bin/debconf-set-selections && apt-get -y install openjdk-15-jre
# Dotnet sonar scanner installation
RUN dotnet tool install --global dotnet-sonarscanner
ENV PATH="${PATH}:/root/.dotnet/tools"
# Ef tools installation
RUN dotnet tool install --global dotnet-ef
ENV PATH="${PATH}:/root/.dotnet/tools"
# Restores (downloads) all NuGet packages from all projects of the solution (Test is ignored)
COPY . ./