drone docker image
This commit is contained in:
parent
39286ab94a
commit
0a64ab69eb
3 changed files with 38 additions and 97 deletions
|
@ -1,7 +1,8 @@
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
steps:
|
steps:
|
||||||
- name: compile
|
- name: docker
|
||||||
image: mcr.microsoft.com/dotnet/sdk:5.0
|
image: plugins/docker
|
||||||
commands:
|
settings:
|
||||||
- sh build.sh
|
repo: privateregistry.michelescandura.com/michele/basecompileimage
|
||||||
|
registry: privateregistry.michelescandura.com
|
||||||
|
|
25
BaseCompileImage/Dockerfile
Normal file
25
BaseCompileImage/Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
FROM ubuntu:focal
|
||||||
|
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
wget \
|
||||||
|
ca-certificates \
|
||||||
|
\
|
||||||
|
# Install Microsoft package feed
|
||||||
|
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
|
||||||
|
&& dpkg -i packages-microsoft-prod.deb \
|
||||||
|
&& rm packages-microsoft-prod.deb \
|
||||||
|
\
|
||||||
|
# Install .NET
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
apt-transport-https \
|
||||||
|
dotnet-sdk-5.0 \
|
||||||
|
dotnet-sdk-3.1 \
|
||||||
|
libpng16-16 \
|
||||||
|
libnvtt-dev \
|
||||||
|
\
|
||||||
|
# Cleanup
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN dotnet tool install -g dotnet-mgcb
|
101
Dockerfile
101
Dockerfile
|
@ -1,95 +1,10 @@
|
||||||
# https://hub.docker.com/_/microsoft-dotnet-core
|
FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
||||||
#FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
|
||||||
# FROM alpine AS build
|
|
||||||
#ARG REPO=mcr.microsoft.com/dotnet/aspnet
|
|
||||||
#FROM $REPO:5.0-alpine3.12-amd64
|
|
||||||
|
|
||||||
#ENV \
|
|
||||||
# # Unset ASPNETCORE_URLS from aspnet base image
|
|
||||||
# ASPNETCORE_URLS= \
|
|
||||||
# DOTNET_SDK_VERSION=5.0.100 \
|
|
||||||
# # Disable the invariant mode (set in base image)
|
|
||||||
# DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
|
|
||||||
# # Enable correct mode for dotnet watch (only mode supported in a container)
|
|
||||||
# DOTNET_USE_POLLING_FILE_WATCHER=true \
|
|
||||||
# # Skip extraction of XML docs - generally not useful within an image/container - helps performance
|
|
||||||
# NUGET_XMLDOC_MODE=skip \
|
|
||||||
# # PowerShell telemetry for docker image usage
|
|
||||||
# POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Alpine-3.12##
|
|
||||||
|
|
||||||
#RUN apk add --no-cache \
|
|
||||||
# curl \
|
|
||||||
# icu-libs \
|
|
||||||
# wget \
|
|
||||||
# git \
|
|
||||||
# bash
|
|
||||||
#
|
|
||||||
#WORKDIR /installer
|
|
||||||
#RUN wget https://dot.net/v1/dotnet-install.sh
|
|
||||||
##COPY ./dotnet-install.sh ./dotnet-install.sh
|
|
||||||
#RUN chmod +x dotnet-install.sh
|
|
||||||
#RUN ./dotnet-install.sh --channel 3.1
|
|
||||||
#RUN ./dotnet-install.sh --channel 5.0
|
|
||||||
#RUN export PATH=~/.dotnet:$PATH
|
|
||||||
#RUN export DOTNET_ROOT=~/.dotnet
|
|
||||||
#RUN export PATH=$PATH:~/.dotnet
|
|
||||||
##ENV PATH="${PATH}:~/.dotnet"
|
|
||||||
#ENV PATH="~/.dotnet:${PATH}"
|
|
||||||
|
|
||||||
#RUN which dotnet
|
|
||||||
# # Install .NET CLI dependencies
|
|
||||||
# RUN apt-get update \
|
|
||||||
# && apt-get install -y --no-install-recommends \
|
|
||||||
# libc6 \
|
|
||||||
# libgcc1 \
|
|
||||||
# libgssapi-krb5-2 \
|
|
||||||
# libicu60 \
|
|
||||||
# libssl1.1 \
|
|
||||||
# libstdc++6 \
|
|
||||||
# zlib1g \
|
|
||||||
# && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# # Install .NET Core SDK
|
|
||||||
# RUN dotnet_sdk_version=3.1.404 \
|
|
||||||
# && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \
|
|
||||||
# && dotnet_sha512='94d8eca3b4e2e6c36135794330ab196c621aee8392c2545a19a991222e804027f300d8efd152e9e4893c4c610d6be8eef195e30e6f6675285755df1ea49d3605' \
|
|
||||||
# && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
|
|
||||||
# && mkdir -p /usr/share/dotnet \
|
|
||||||
# && tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
|
|
||||||
# && rm dotnet.tar.gz \
|
|
||||||
# && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
|
|
||||||
# # Trigger first run experience by running arbitrary cmd
|
|
||||||
# && dotnet help
|
|
||||||
FROM ubuntu:groovy as build
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
&& apt-get update \
|
|
||||||
# Install prerequisites
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
wget \
|
|
||||||
ca-certificates \
|
|
||||||
\
|
|
||||||
# Install Microsoft package feed
|
|
||||||
&& wget -q https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
|
|
||||||
&& dpkg -i packages-microsoft-prod.deb \
|
|
||||||
&& rm packages-microsoft-prod.deb \
|
|
||||||
\
|
|
||||||
# Install .NET
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
dotnet-sdk-5.0 \
|
|
||||||
dotnet-sdk-3.1 \
|
|
||||||
libpng12 \
|
|
||||||
\
|
|
||||||
# Cleanup
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# copy csproj and restore as distinct layers
|
# copy csproj and restore as distinct layers
|
||||||
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
||||||
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
||||||
COPY Sledgemapper/*.csproj ./Sledgemapper/
|
# COPY Sledgemapper/*.csproj ./Sledgemapper/
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /src/Sledgemapper.Api
|
WORKDIR /src/Sledgemapper.Api
|
||||||
|
@ -99,7 +14,7 @@ WORKDIR /src/Sledgemapper.Shared
|
||||||
RUN dotnet restore
|
RUN dotnet restore
|
||||||
|
|
||||||
WORKDIR /src/Sledgemapper
|
WORKDIR /src/Sledgemapper
|
||||||
RUN dotnet restore
|
# RUN dotnet restore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,13 +23,13 @@ RUN dotnet restore
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
||||||
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
||||||
COPY Sledgemapper/. ./Sledgemapper/
|
#COPY Sledgemapper/. ./Sledgemapper/
|
||||||
WORKDIR /src/Sledgemapper
|
#WORKDIR /src/Sledgemapper
|
||||||
|
|
||||||
COPY build.sh .
|
#COPY build.sh .
|
||||||
|
|
||||||
RUN chmod +x build.sh
|
#RUN chmod +x build.sh
|
||||||
RUN sh build.sh
|
#RUN sh build.sh
|
||||||
WORKDIR /src/Sledgemapper.Api
|
WORKDIR /src/Sledgemapper.Api
|
||||||
RUN dotnet publish -c release -o /app --no-restore
|
RUN dotnet publish -c release -o /app --no-restore
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue