Skip to content
This repository has been archived by the owner on Feb 22, 2025. It is now read-only.

Commit

Permalink
[ci] alpine dockerimage changes (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachmatt authored Feb 16, 2024
1 parent 4f28c7e commit db6ea50
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 24 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on:

env:
buildConfiguration: Release
dotnetSdkVersion: 7.0.202
dotnetSdkVersion: 7.0.406
relativeTracerHome: /shared/bin/monitoring-home/tracer
relativeArtifacts: /tracer/src/bin/artifacts
binDir: ${{ github.workspace }}/tracer/src/bin
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
3.1.426
5.0.408
6.0.419
7.0.202
7.0.406
8.0.200
- name: Install CMake 3.19.8
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: Build Docker image
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- run: ./tracer/build.cmd Clean BuildTracerHome BuildAndRunManagedUnitTests
Expand All @@ -211,7 +211,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: Build Docker image
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: Install CMake 3.19.8
Expand All @@ -286,7 +286,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: Build Docker image
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
# Cosmos is _way_ to flaky at the moment. Try enabling again at a later time
Expand Down Expand Up @@ -397,7 +397,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: Remove large node images
Expand Down Expand Up @@ -472,7 +472,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: install Microsoft.Net.Component.4.6.1.TargetingPack
Expand Down Expand Up @@ -523,7 +523,7 @@ jobs:
2.1.818
3.1.426
6.0.419
7.0.202
7.0.406
8.0.200
- name: install Microsoft.Net.Component.4.6.1.TargetingPack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
3.1.426
5.0.408
6.0.419
7.0.202
7.0.406
8.0.200
- run: tracer\build.cmd Clean BuildTracerHome PackageTracerHome
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ linux-build:
matrix:
- baseImage: [ alpine, debian ]
variables:
dotnetSdkVersion: 7.0.202
dotnetSdkVersion: 7.0.406
script:
- |
rm .dockerignore
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ services:
context: ./tracer/build/_build/
dockerfile: docker/${baseImage:-centos7}.dockerfile
args:
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.202}
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.406}
image: dd-trace-dotnet/${baseImage:-centos7}-tester
command: dotnet /build/bin/Debug/_build.dll RunProfilerLinuxIntegrationTests
volumes:
Expand All @@ -510,7 +510,7 @@ services:
context: ./tracer/build/_build/
dockerfile: docker/${baseImage:-centos7}.dockerfile
args:
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.202}
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.406}
image: dd-trace-dotnet/${baseImage:-centos7}-tester
command: /bin/sh -c './tracer/build.sh RunLinuxIntegrationTests --framework ${framework:-netcoreapp3.1} --code-coverage'
volumes:
Expand Down Expand Up @@ -571,7 +571,7 @@ services:
context: ./tracer/build/_build/
dockerfile: docker/${baseImage:-centos7}.dockerfile
args:
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.202}
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.406}
image: dd-trace-dotnet/${baseImage:-centos7}-tester
command: dotnet /build/bin/Debug/_build.dll RunExplorationTests --explorationTestUseCase ${explorationTestUseCase:-debugger} --explorationTestName ${explorationTestName:-eshoponweb} --framework ${framework:-netcoreapp3.1} --code-coverage
volumes:
Expand Down Expand Up @@ -614,7 +614,7 @@ services:
context: ./tracer/build/_build/
dockerfile: docker/${baseImage:-debian}.dockerfile
args:
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.202}
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.406}
image: dd-trace-dotnet/${baseImage:-debian}-tester
command: dotnet /build/bin/Debug/_build.dll RunLinuxIntegrationTests --framework ${framework:-netcoreapp3.1}
volumes:
Expand Down
53 changes: 49 additions & 4 deletions tracer/build/_build/docker/alpine.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
FROM alpine:3.16 as base
ARG DOTNETSDK_VERSION
FROM mcr.microsoft.com/dotnet/sdk:$DOTNETSDK_VERSION-alpine3.16 as base

# SECURITY NOTE: Exception is made for APK packages,
ENV \
# Unset ASPNETCORE_URLS from aspnet base image
ASPNETCORE_URLS= \
# Do not generate certificate
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
# Do not show first run text
DOTNET_NOLOGO=true \
# SDK version
DOTNET_SDK_VERSION=$DOTNETSDK_VERSION \
# 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
# Disable LTTng tracing with QUIC
# QUIC_LTTng=0

# SECURITY NOTE: Exception is made for APK packages,
# no need to lock versions
RUN apk update \
&& apk upgrade \
&& apk add --no-cache --update \
ca-certificates \
\
# .NET Core dependencies
krb5-libs \
libgcc \
libintl \
libssl1.1 \
libstdc++ \
zlib-dev \
\
# SDK dependencies
curl \
icu-data-full \
icu-libs \
\
# our dependencies
clang \
cmake \
git \
Expand All @@ -26,7 +60,18 @@ RUN apk update \
&& gem install --version 2.7.6 dotenv \
&& gem install --version 1.14.1 --minimal-deps --no-document fpm

ENV IsAlpine=true
ENV IsAlpine=true \
DOTNET_ROLL_FORWARD_TO_PRERELEASE=1

# Install the .NET SDK
RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \
&& echo "SHA256: $(sha256sum dotnet-install.sh)" \
&& echo "5eb82d8578f55cdadcb2edfd35ec649a2c6fc11a682e876b1cd68077badbf794 dotnet-install.sh" | sha256sum -c \
&& chmod +x ./dotnet-install.sh \
&& ./dotnet-install.sh --version $DOTNETSDK_VERSION --install-dir /usr/share/dotnet \
&& rm dotnet-install.sh \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& dotnet help

FROM base as releaser
COPY . /project
Expand All @@ -41,7 +86,7 @@ FROM base as tester
# Install .NET Core runtimes using install script
RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \
&& echo "SHA256: $(sha256sum dotnet-install.sh)" \
&& echo "ff2ff47318ffff0af9a6395ca6308b54376fba8c97a3a5eba3e848b0caf17b58 dotnet-install.sh" | sha256sum -c \
&& echo "5eb82d8578f55cdadcb2edfd35ec649a2c6fc11a682e876b1cd68077badbf794 dotnet-install.sh" | sha256sum -c \
&& chmod +x ./dotnet-install.sh \
&& ./dotnet-install.sh --runtime aspnetcore --version 2.1.30 --install-dir /usr/share/dotnet --no-path \
&& ./dotnet-install.sh --runtime aspnetcore --version 3.1.31 --install-dir /usr/share/dotnet --no-path \
Expand Down
4 changes: 2 additions & 2 deletions tracer/build/_build/docker/debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN apt-get update \
# Install the .NET SDK
RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \
&& echo "SHA256: $(sha256sum dotnet-install.sh)" \
&& echo "ff2ff47318ffff0af9a6395ca6308b54376fba8c97a3a5eba3e848b0caf17b58 dotnet-install.sh" | sha256sum -c \
&& echo "5eb82d8578f55cdadcb2edfd35ec649a2c6fc11a682e876b1cd68077badbf794 dotnet-install.sh" | sha256sum -c \
&& chmod +x ./dotnet-install.sh \
&& ./dotnet-install.sh --version $DOTNETSDK_VERSION --install-dir /usr/share/dotnet \
&& rm ./dotnet-install.sh \
Expand Down Expand Up @@ -76,7 +76,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; \
fi \
&& curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \
&& echo "SHA256: $(sha256sum dotnet-install.sh)" \
&& echo "ff2ff47318ffff0af9a6395ca6308b54376fba8c97a3a5eba3e848b0caf17b58 dotnet-install.sh" | sha256sum -c \
&& echo "5eb82d8578f55cdadcb2edfd35ec649a2c6fc11a682e876b1cd68077badbf794 dotnet-install.sh" | sha256sum -c \
&& chmod +x ./dotnet-install.sh \
&& ./dotnet-install.sh --runtime $NETCORERUNTIME2_1 --version 2.1.30 --install-dir /usr/share/dotnet --no-path \
&& ./dotnet-install.sh --runtime aspnetcore --version 3.1.31 --install-dir /usr/share/dotnet --no-path \
Expand Down
2 changes: 1 addition & 1 deletion tracer/build_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BUILD_DIR="$ROOT_DIR/tracer/build/_build"
IMAGE_NAME="signalfx-dotnet-tracing/debian-base"

docker build \
--build-arg DOTNETSDK_VERSION=7.0.202 \
--build-arg DOTNETSDK_VERSION=7.0.406 \
--tag $IMAGE_NAME \
--file "$BUILD_DIR/docker/centos7.dockerfile" \
"$BUILD_DIR"
Expand Down

0 comments on commit db6ea50

Please sign in to comment.