-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from codacy/bump-things-up
Updates to latest versions (IO-397)
- Loading branch information
Showing
9 changed files
with
124 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codacy: codacy/[email protected].0 | ||
codacy: codacy/[email protected].1 | ||
codacy_plugins_test: codacy/[email protected] | ||
|
||
workflows: | ||
|
@@ -10,9 +10,9 @@ workflows: | |
jobs: | ||
- codacy/checkout_and_version | ||
- codacy/shell: | ||
name: build_test_publish_local | ||
name: publish_local | ||
cmd: | | ||
docker build . -t $CIRCLE_PROJECT_REPONAME:latest | ||
docker build -t $CIRCLE_PROJECT_REPONAME:latest . | ||
docker save --output docker-image.tar $CIRCLE_PROJECT_REPONAME:latest | ||
persist_to_workspace: true | ||
requires: | ||
|
@@ -23,15 +23,14 @@ workflows: | |
run_json_tests: false | ||
run_pattern_tests: false | ||
requires: | ||
- build_test_publish_local | ||
- publish_local | ||
- codacy/publish_docker: | ||
context: CodacyDocker | ||
requires: | ||
- plugins_test | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
only: master | ||
requires: | ||
- plugins_test | ||
- codacy/tag_version: | ||
name: tag_version | ||
context: CodacyAWS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" /> | ||
</ItemGroup> | ||
</Project> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,30 @@ | ||
FROM ubuntu:20.04 as base | ||
ARG DOTNET_VERSION=6.0 | ||
ARG DOTNET_BASE_OS=alpine3.17 | ||
|
||
# setup mono repo | ||
RUN apt -y update && \ | ||
apt install -y --no-install-recommends gnupg ca-certificates && \ | ||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ | ||
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \ | ||
apt purge -y --auto-remove gnupg && \ | ||
apt -y update | ||
|
||
|
||
FROM base as builder | ||
|
||
ENV TZ=Europe/Lisbon | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
# Install complete mono and its dependencies | ||
RUN apt -y install mono-complete build-essential unzip | ||
|
||
# Install dotnet sdk | ||
RUN apt-get -y update && \ | ||
apt-get install -y apt-transport-https wget make && \ | ||
wget 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 && \ | ||
apt-get update && \ | ||
apt-get install -y dotnet-sdk-6.0 | ||
## BUILD IMAGE | ||
FROM mcr.microsoft.com/dotnet/sdk:$DOTNET_VERSION-$DOTNET_BASE_OS AS builder | ||
|
||
COPY . /workdir | ||
WORKDIR /workdir | ||
|
||
RUN make publish | ||
RUN make run-tests | ||
RUN apk add --no-cache make &&\ | ||
make &&\ | ||
make publish | ||
|
||
|
||
## RUNTIME IMAGE | ||
FROM mcr.microsoft.com/dotnet/runtime:$DOTNET_VERSION-$DOTNET_BASE_OS | ||
|
||
COPY --from=builder /workdir/src/Analyzer/bin/Release/net6/publish/ /opt/docker/bin/ | ||
|
||
FROM alpine:3.17 | ||
# Create NON-ROOT user | ||
RUN adduser -u 2004 -D docker | ||
|
||
COPY --from=builder /workdir/src/Analyzer/bin/Release/net48/publish/Analyzer.exe /opt/docker/bin/ | ||
COPY --from=builder /workdir/src/Analyzer/bin/Release/net48/publish/*.dll /opt/docker/bin/ | ||
# From now on, run as NON-ROOT user | ||
USER docker | ||
|
||
RUN apk add --no-cache mono --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\ | ||
apk add --no-cache --virtual=.build-dependencies ca-certificates &&\ | ||
cert-sync /etc/ssl/certs/ca-certificates.crt &&\ | ||
apk del .build-dependencies &&\ | ||
adduser -u 2004 -D docker | ||
# Disable diagnostics stuff from dotnet that are turned on by default. | ||
# Should make the image even more "read-only". | ||
ENV DOTNET_EnableDiagnostics=0 | ||
|
||
ENTRYPOINT [ "mono", "/opt/docker/bin/Analyzer.exe" ] | ||
ENTRYPOINT [ "dotnet", "/opt/docker/bin/Analyzer.dll" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters